I have been mapping user flow from screen to screen using the storbyboard, but now I have a need to programmatically redirect the user from one controller to another.
I tried to look up how to do that, but I am not finding much, partially because I am not sure how to word this correctly 🙂
I know in Android it is as simple as creating a new Intent object and telling it which other screen to go to..but how do I do this in iOS?
Thank you!
Check out the UIStoryboard class.
Try creating the new controller using – (id)instantiateViewControllerWithIdentifier:(NSString *)identifier from the main Storyboard.
You can then use the new view controller as you would normally.
[EDIT]
You need to give your LoginController the Identifier of “LoginController”.
“MainStoryboard” is the default name for the main storyboard.
[EDIT]
The name of the main storyboard is listed in your plist file as “Main storyboard file base name” (UIMainStoryboardFile).
To set the Identifier of the LoginController:
If you are looking at the storyboard in xcode select the “Login Controller” view controller (shown under the Login Controller Scene) show the attributes inspector found in the Utilities pane (right hand side pane) and under the View Controller section you will see the Identifier field. Set this to “LoginController” – for the example above