Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I go to another view without a StoryBoard segue? Just with a call from a view?

SO I would like to know if there is a possibility to make a call from a view in the code to go to another view, not using segue.

Thanks for the help.

like image 650
alex Avatar asked Jul 13 '12 15:07

alex


1 Answers

Yes, if you are using a navigation controller, you simply need to push onto the navigation controller:

[self.navigationController pushViewController:otherViewCon animated:YES];

Or, if you want a modal transition:

[self presentModalViewController:otherViewCon animated:YES];

This is all assuming self is a UIViewController.

To get otherViewCon from a storyboard designed view controller:

otherViewCon = [self.storyboard instantiateViewControllerWithIdentifier:@"Other View"];
like image 144
Dan F Avatar answered Sep 30 '22 03:09

Dan F