Implementing 3D Touch Quick Launch with Objective C

Hello There!

Today, we will talk about implementing the 3D Touch for iOS Devices using  “OBJECTIVE C“.

I will take couple of minutes (please bear :)) to vent out my frustration at Apple KB for giving Objective C a step-motherly treatment for promoting their retarded Swift language for documenting new features.

The reason I have emphasized Objective C above is because of a reason; there isn’t any proper documentation available written in Objective C for using / implementing 3D Touch. I did spend time to understand and implement 3D Touch in Objective C and I don’t want others to through the same process. OK – So Let’s Get Started !!

This blog assumes the reader has a knowledge of Objective C, XCode IDE and Apple’s newest feature – 3D Touch!

There are 5 Steps to implement this!

Step 1:

Open Xcode and create a Single View Application, with the name “test3D”

Screen Shot 2015-12-19 at 1.52.42 PM.pngScreen Shot 2015-12-19 at 1.53.55 PM.png

Step 2:

You need to remember, that the Quick Launch feature of 3D Touch, is actually executed from your Home Screen. So, you need to keep the following attributes ready:

  1. Image for the Quick Launch
  2. Quick Launch Shortcut Title
  3. Quick Launch Sub-Title

Step 3: In your XCode Project, open the Assets.xcassets image catalog file, and right click on vacant area, you will be shown a context menu option. Click the “New Image Set” menu.

Screen Shot 2015-12-19 at 2.07.39 PM.png

After clicking the New Image Set menu, you will be shown an area, where-in you can drag and drop your image on the three image image placeholders, as shown below:

Screen Shot 2015-12-19 at 2.13.21 PM.png

You are required to drop three images, one onto each placeholder.

I dropped in an image for 1x at 35px X 35px and for 2x – 70px X 70px and for 3x – 105px X 105px

Remember: For each menu option, there would be a new Image Catalogue that needs to be created.

For now lets use only a single menu for our 3D Touch Quick Launch example. An appropriate / meaningful name must be given to each of the image set catalogue.

Step 3:

Now lets shift our focus on the Info.plist file we have in our project.

Here you need to create an Array of Dictionary type for each of the Quick Launch menu option.

In the Info.plist file, right click the row and click “Add Row”

Screen Shot 2015-12-19 at 3.07.37 PM.png

And then add the UIApplicationShortcutItems Key with the Type Array.

Screen Shot 2015-12-19 at 3.08.18 PM.png

Now add a new Dictionary within the newly created UIApplicationShortcutItems array. Right click on the UIApplicationShortcutItems array and click Add Row as shown below:

Screen Shot 2015-12-19 at 3.12.45 PM.png

Now add Item 0 with type Dictionary

Screen Shot 2015-12-19 at 3.13.00 PM.png

You need to add 4 attributes into this Dictionary:

  1. UIApplicationShortcutItemTitle
  2. UIApplicationShortcutItemSubtitle
  3. UIApplicationShortcutItemType
  4. UIApplicationShortcutItemIconFile

UIApplicationShortcutItemTitle: Here is where you add give title to your Quick Launch menu item

UIApplicationShortcutItemSubtitle: Here is where you add a “meaningful” subtitle to your Quick Launch Shortcut Item

UIApplicationShortcutItemType: You must give a name to your ShortCut item. This name will be identified in this application, when the QuickLaunch Item will be pressed. So again, please give a meaningful name to it

UIApplicationShortcutItemIconFile: It is here that you refer the name of your Icon Catalogue in Step 2. In our example it was just by the name “Image”.

As shown below, we add the four Quick Launch attributes to the Dictionary item:

Screen Shot 2015-12-19 at 4.19.29 PM.png

Step 4:

Now we will shift our focus to the AppDelete file in our project. Click open the AppDelegate.m file and add the completionHandler for the ShortcutItem


Screen Shot 2015-12-19 at 4.56.37 PM.png

*NOTE: I have declared a global variable by the name


Firstly, Add the Below code into application:didFinishLaunchingWithOptions function

Screen Shot 2017-01-11 at 10.24.52 PM.png

* I have removed few boiler plate code here from the AppDelegate.m

Add Global Variable with the name asShortCutType

Screen Shot 2015-12-19 at 4.58.37 PM.png

Screen Shot 2015-12-19 at 4.58.47 PM.png

Please note that in the shortcutItem.type check, we are specifying the name that we had added into the UIApplicationShortcutItemType attribute – <Product Bundle Identifier>.Square

By now, your application should be having a Quick Launch short cut item popping out, when you press on the application icon in the Home Screen


Now when you press the Square Quick Launch menu item, the completion handler in the AppDelete.m gets fired. It is here that, if you have multiple menu item, then you can identify it by using Global Variable declared in the AppDelegate file.

In our example, the global variable is by name asShortCutType


Add the reference to AppDelegate.h file. And add the code in the viewDidLoad event of the ViewController. It is here that the value of the variable in the AppDelete.h file gets passed to the ViewController, and the ViewController gets notified, which menu option was clicked.

Screen Shot 2015-12-19 at 5.11.35 PM.png

Step 5: (Last but very important!)

Now that you are enjoying that the Quick Launch is getting fired, there is one more thing to apply the 3D Touch Quick Launch completely.

There is a stage in the application, where in the application is in the background state, when you press the home button.

In that case, the viewDidLoad event will not fire at all and your ViewController will not get to know, which menu option got clicked.

There is a workaround for this too 🙂 . In your viewDidLoad event handler, add the below line of code:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(check) name:UIApplicationDidBecomeActiveNotification object:nil];

.. and add a method by the name “check” as mentioned in the quote above.

Screen Shot 2015-12-19 at 5.11.46 PM.png



Rohant K.


One thought on “Implementing 3D Touch Quick Launch with Objective C

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s