Switch from network:
1. Get a storyboard object (the uistoryboard class object ).
If you have an existing View Controller that is instantiated from the same storyboard, you can obtain the storyboard object through its storyboard attribute. To load another storyboard object, you can call the class method storyboardwithname: Bundle: Of the uistoryboard, and pass the file name and an optional bundle of the storyboard as parameters to this method.
2. Call the instantiateviewcontrollerwithidentifier method of the storyboard object to pass the identifier defined when you create the View Controller in interface builder to this method.
Alternatively, you can use the instantiateinitialviewcontroller method to instantiate the first view controller of the storyboard without specifying an identifier.
3. display the New View Controller.
====================
The following code is more clear:
====================
In the code, how does one call a scene that has been designed in storyboard? The Code is as follows:
NSString * storyboardName = @"MainStoryboard_iPhone";NSString * viewControllerID = @"ViewID";UIStoryboard * storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil];MyViewController * controller = (MyViewController *)[storyboard instantiateViewControllerWithIdentifier:viewControllerID];[self presentViewController:controller animated:YES completion:nil];
How to use code to call storyboard