Last active
February 15, 2017 08:40
-
-
Save avanish/e11b95fbda6f111228c7509aa73e616c to your computer and use it in GitHub Desktop.
UIViewController navigation without segue or parent UINavigationController
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
// UIViewController nagivation without the navigation controller. | |
// UIStoryboard->UINavigationController | |
// | |
// Initializations | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; | |
SecondViewController *svc = (SecondViewController *)[storyboard instantiateViewControllerWithIdentifier:@"identifierName"]; | |
// Navigation | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self.navigationController pushViewController:svc animated:YES]; | |
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain | |
target:nil action:nil]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment