Sunday, January 31, 2016

iOS 3D Touch

This feature is available on iPhone 6s and iPhone 6s Plus 

There are two ways to do this, 

1. Statically : This is done by defining static quick actions in the info.plist file. This is done by doing UIApplicationShortcutItems array. 
2. Dynamically 

Statically adding is pretty simple. Below is the code to do this 

UIApplicationShortcutItems<!/key>
UIApplicationShortcutItemIconFile<!/key>
icon-manage.png<!/string>
UIApplicationShortcutItemTitle<!/key>
View Nearby hotspots <!/string>
UIApplicationShortcutItemType<!/key>
com.timewarnercable.wifi-finder.viewnearby<!/string>
UIApplicationShortcutItemUserInfo<!/key>
key2<!/key>
value2<!/string>
<!/dict>
<!/dict>
UIApplicationShortcutItemIconType<!/key>
UIApplicationShortcutIconTypeCompose<!/string>
UIApplicationShortcutItemTitle<!/key>
View Usage <!/string>
UIApplicationShortcutItemType<!/key>
com.mycompany.myapp.newmessage<!/string>
UIApplicationShortcutItemUserInfo<!/key>
key2<!/key>
value2<!/string>
<!/dict>
<!/dict>
UIApplicationShortcutItemIconType<!/key>
UIApplicationShortcutIconTypeCompose<!/string>
UIApplicationShortcutItemTitle<!/key>
Manage Devices<!/string>
UIApplicationShortcutItemType<!/key>
com.mycompany.myapp.newmessage<!/string>
UIApplicationShortcutItemUserInfo<!/key>
key2<!/key>
value2<!/string>
<!/dict>
<!/dict>
UIApplicationShortcutItemIconFile<!/key>
open-favorites<!/string>
UIApplicationShortcutItemTitle<!/key>
Request Hotspot<!/string>
UIApplicationShortcutItemType<!/key>
com.mycompany.myapp.openfavorites<!/string>
UIApplicationShortcutItemUserInfo<!/key>
key1<!/key>
value1<!/string>
<!/dict>
<!/dict>

References:

No comments:

Post a Comment