title: How to call a view controller via Quick Actions (3D touch) Swift
body: <p>I'm trying to implement a 3D touch command where if the user presses &quot;New scan&quot;, then the view controller <code>ProcessedImageViewController</code> is called. I have already set up the <code>Info.plist</code> to create the quick option, but I am having trouble actually calling the <code>ProcessedImageViewController</code> when &quot;New scan&quot; is pressed.
  Here is my code from the <code>AppDelegate.swift</code>:</p>
  <pre><code>var launchedShortcutItem: UIApplicationShortcutItem?
      var window: UIWindow?
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
          // Override point for customization after application launch.
          
          
          
          
          if let shortcutItem = launchOptions?[UIApplication.LaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem{
              launchedShortcutItem = shortcutItem
          }
        
          return true
      }
      
      func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -&gt; Void) {
          completionHandler(handleShortcutItem(item: shortcutItem))
      }
  
      func applicationDidBecomeActive(_ application: UIApplication) {
          
          guard let shortcutItem = launchedShortcutItem else { return }
          //If there is any shortcutItem,that will be handled upon the app becomes active
          _ = handleShortcutItem(item: shortcutItem)
          //We make it nil after perfom/handle method call for that shortcutItem action
          launchedShortcutItem = nil
  }
  func handleShortcutItem(item: UIApplicationShortcutItem) -&gt; Bool {
          var handled = false
          // Verify that the provided shortcutItem's type is one handled by the application.
          let mainStoryboard = UIStoryboard.init(name: &quot;Main&quot;, bundle: Bundle.main)
          var reqVC: UIViewController!
          reqVC = mainStoryboard.instantiateViewController(withIdentifier: &quot;ProcessedImageViewController&quot;) as! ProcessedImageViewController
          handled = true
          if let homeVC = self.window?.rootViewController as? UINavigationController {
              homeVC.pushViewController(reqVC, animated: true)
          } else {
              return false
          }
          
          return handled
      }
  
  </code></pre>
  <p>When I try to click on &quot;New scan&quot; in the Quick Actions menu, I only get taken to the Root View controller (not <code>ProcessedImageViewController</code>).</p>