Hello,
I am playing around with adding 3D Touch quick actions to my app, and I need one of them to take the user to a view controller that is embedded in a navigation controller. Let me explain:
Navigation Controller -> Main Page View Controller -> The View Controller I need to get to
I have tried many things to try to get this to work. First, I tried presenting the view controller I need to get to (Let's call it "ViewController") straight from the App Delegate, where the 3D Touch quick actions get "received", so to say. That worked originally, but the navigation bar wasn't there, so you couldn't get back to the MainViewController (In the example it is called "Main Page View Controller").
Then, I tried presenting the MainViewController, and from there presenting ViewController. That didn't work, there still wasn't a nav bar. Lastly, I tried presenting the Navigation Controller, and then presenting the MainViewController form there, and presenting ViewController from the MainViewController to no avail.
This is the function in the AppDelegate I'm trying to present ViewController from
@available(iOS 9.0, *)
func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
if shortcutItem.type == "com.hp.Userword-Username-And-Password-Generator.generatePassword" {
//Where to run the code to get to ViewController
}
}
Is there anyone who knows how to do this? Thanks in advance. Any help is appreciated.