Unfortunately, the UIStoryboard not able to visually manipulate the UINavigationController hierarchy. In your case, you need to establish a hierarchy programmatically in the application deletion. Fortunately, because you are storyboards, your application delegate already contains a link to this navigation controller.
In the storyboard, the so-called "initial view controller" will be connected to the rootViewController property in the UIWindow application instance by the time the -applicationDidFinishLaunchingWithOptions: message is -applicationDidFinishLaunchingWithOptions: .
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)options { UINavigationController *navController = (UINavigationController *)self.window.rootViewController; MenuViewController *menu = [navController.storyboard instantiateViewControllerWithIdentifier:@"MenuController"]; CustomViewController *custom = [navController.storyboard instantiateViewControllerWithIdentifier:@"CustomController"]; // First item in array is bottom of stack, last item is top. navController.viewControllers = [NSArray arrayWithObjects:menu, custom, nil]; [self.window makeKeyAndVisible]; return YES; }
I understand that this is not ideal, but if you want to stay in the country of the storyboard, I am afraid that this is the only way.
source share