Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UINavigationController->UIViewController navigation without segue
// 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