I have a basic navigation stack: NavController->UITableViewController (as rootViewController in the NavController) -> menu items with the main option being a custom viewController. I want my app to launch with the main custom view controller as the current view on the navigationController’s stack, and the back button to go to the Main Menu. Is there some way using storyboarding to setup the stack this way and yet on launch show the custom view first?
I’m trying to do this in storyboarding as much as possible. I know I could go in the appDelegate and on appDidFinishLaunching… push the custom viewController into the navController but that just seems bad because then in my appDelegate I have to reference the navController and the custom viewController.
Unfortunately
UIStoryboardisn’t able to manipulate aUINavigationControllerhierarchy in a visual way. In your case, you need to establish the hierarchy programmatically in your application delegate. Luckily, because you are storyboarding, your app delegate already contains a reference to this navigation controller.When storyboarding, the so called “Initial View Controller” will be wired up to the
rootViewControllerproperty on the application’s instance ofUIWindowby the time-applicationDidFinishLaunchingWithOptions:is messaged.I realize this isn’t ideal, but if you want to stay in the land of storyboards, I’m afraid this is the only way.