Continuing from the previous post; once you have the UI defined - we need to be able to handle that the app is launched by pressing one of the UIApplicationShortcutItems instead of conventional icon click. The key to detecting this in the app is the appDelegate class (the startup class). As you might remember from part 1, we gave the shortcutItems a unique type (a unique string). These strings are used to identify to the app what shortcut item has been pressed.
As seen from the below image - the first thing when the app is launched is to check the launchOptions argument. If it is possible to cast that as a UIApplicationShortcutItem - we have been launched from such UISchortcutItem.
The next thing is to determine which item (item1 or item 2) has been used to launch the app.
In my sample app - the startup viewcontroller as seen below is a TabbarController that normally would start the left hand child viewcontroller (Network Info) as this has index = 0 (default). Therefore I can just set the selectedIndex on the tabbarController as seen in the code above. This will allow me to either select the Network Info or Cell Info tab. All from the UIShortcutItem.
5 comments:
I like this post,And I guess that they having fun to read this post,they shall take a good site to make a information,thanks for sharing it to me. TutuApp Android
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging, Cydia Download iOS 11.3
Thank you so much for your valuable information. I wrote about AppValley. You can also check it from this website.
AppValley - #1 Third Party App Store | iOS | Download
Thank you so much for your valuable information. I'm also and author visit my How to use Slick TV guide Article https://telegra.ph/Download-Slick-TV-using-AppValley-04-06
Hi there . I am developer and I want you to visit my site . Here is the link of my site jsononline
Post a comment