app delegate viewcontroller unwind

When I receive a request to open the app directly to a certain customViewController, I am able to handle that request within AppDelegate and open direct to that viewController like so:


let storyBoard = UIStoryboard(name: "Main", bundle: nil)
guard let controller = storyBoard.instantiateViewController(withIdentifier: "CustomViewController") as? CustomViewController else {

self.window?.rootViewController = controller

This opens my custom view directly as I want, and I can segue from there forward, but the unwind segues back aren’t firing, I assume they’re not being created due to the way the AppDelegate makes this view the rootViewController, bypassing other parts of my storyboard’s structure.


What is the better way here to start my app from AppDelegate so that the view hierarchy and segues are all set as they would be in a typical app opening instance?


In normal navigation, there are two show segues that are performed on the way to my customViewController from the initial Storyboard entry point viewController.


Any advice about how to accomplish this directly from AppDelegate but then still allow the user to navigate freely around the app using the segues/unwindsegues built in to the storyboard would be greatly appreaciated! Thanks so much in advance!

Powered by WPeMatico

You may also like...

Comments are closed.