I have a storyboard created with 2 views. ViewController1 and ViewController2. What I want to be able to do is after a user fills in specific fields and clicks the “Login” button on view1, is transition the user to view2.
I have the button successfully linked up to a method that executes when it is pressed I am just not sure how to do the transition.
This is patterned off the standard IOS
Utilitytemplate:1) In your storyboard, set up a Modal segue from view controller 1 to 2. Do this by control dragging from the view controller 1 icon (icon on the right at the bottom of your view controller) to view controller 2. Select
modalas the transition type and give this segue an identifier such asShowViewController2.2) In your implementation file for view controller 1, call this when the user presses
Log InThen implement
prepareForSeguein viewController1 to set up viewController2:Also, implement a method in view controller 1 to be called when view controller 2 is done
For view controller 2, you’ll want to set up a setter for
delegatewithWhen it is time to return to view controller 1 (ie when the user logs out), call: