Dina Hussieny Dina Hussieny - 1 year ago 87
Objective-C Question

Force touch the app icon when app closed from task manager

while using quick actions of 3D Touch it works good but while app is terminated first time force touch the app icon it open home screen but the other times it open the right screen.
why this happen and how I can test the app while it is terminated

Answer Source

From the method application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) you can use the launchOptions argument to detect whether user is launching the app by pressing shortcut item key or not.

if launchOptions != nil {
        if let userInfo = launchOptions![UIApplicationLaunchOptionsShortcutItemKey] {
            //Handled the implementation here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download