Created
February 20, 2015 10:23
-
-
Save zhangyuan/3a24adc14f8613b12f13 to your computer and use it in GitHub Desktop.
UINavigationController popToRootViewController, and then immediately push a new one
This file contains hidden or 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
| // http://stackoverflow.com/questions/954982/uinavigationcontroller-poptorootviewcontroller-and-then-immediately-push-a-new | |
| MyViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"]; | |
| UINavigationController * navigationController = self.navigationController; | |
| [navigationController popToRootViewControllerAnimated:NO]; | |
| [navigationController pushViewController:controller animated:YES]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment