Created
February 2, 2017 08:34
-
-
Save avanish/8a55e8770e3281cd4462f851127f18b8 to your computer and use it in GitHub Desktop.
UINavigationController->UIViewController navigation without segue
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
// UIStoryboard->UINavigationController->UIViewController | |
// | |
// Initializations | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; | |
UINavigationController *controller = (UINavigationController *)[storyboard instantiateViewControllerWithIdentifier:@"identifier"]; | |
SecondViewController *svc = (SecondViewController *)controller.topViewController; | |
// Passing data | |
svc.some_code = self.object.some_code; | |
// Navigation | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self.navigationController presentViewController:controller animated:YES completion:nil]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment