An example for UIApplicationShortcutWidget in iOS with Objective C

1.9k views Asked by At

enter image description here

I need an example (in Objective C) for how to add UIApplicationShortcutWidget with 3D Touch Quick launch icon. Image preview shows sample of Google maps.

1

There are 1 answers

1
abdul sathar On BEST ANSWER

First you need understood about app Extensions (Introduced from iOS 10).

Step 1.Just follow this tutorial https://www.appcoda.com/app-extension-programming-today

Step 2. Create today widget app extension(You can create upto n number of widgets).

Step 3. It will displyed on notication center of phone (Tutorial guides you.)

Step 4. Choose any one widget.Copy your widget with bundle id.

Step 5. Paste into your info.plist like UIApplicationShortcutWidget com.companyname.projectname.YourWidgetName

Step6. It will showed like below image enter image description here

Note :Only one widget will be shown in 3D Touch.So select any one to paste it on info.plist.

Final Step:Build and Run ,Your widget(App extension view) showed on phone notification center(swipe left or right edit option available,you can add/remove also manually for app extension view ).For 3D Touch just force touch the app icon ,it will show the widget on your top or bottom of the app icon based on icon position.