Created
February 19, 2016 17:33
-
-
Save Qiki/6ff662ab35fb07e2914a to your computer and use it in GitHub Desktop.
UINavigationController initWithRootViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So there is tricky thing (it will happen sometimes) | |
/* | |
* When set a storyboardID in a viewcontroller, and you want to show the navigation item | |
* you need to init NavigationController with rootviewcontoller | |
*/ | |
UIViewControllers *niceVC = [shop instantiateViewControllerWithIdentifier:@"nice"]; | |
UINavigationController *niceNav = [[UINavigationController alloc] initWithRootViewController:nice]; | |
---------------------------------------- | |
There is a same thing we can do it in storyboard | |
So we create a UIViewController in storyboard, and embbed in navigationController, set the navigationController storyboard id to "nice". | |
And return it, it will be a navigation controller with roote view controller with niceVC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment