In this recipe, we will learn how we can use the storyboard features to transition to another view controller through code.
In this section, we will look at how we can programmatically transition to another view controller through the use of segues.
In order to programmatically perform a transition to another view controller using a segue, perform the following simple steps:
Select the
MainStoryboard.storyboard
file from the project navigator.Select the segue relationship for the About Twitter App button.
Click on the Attributes Inspector button.
Change the Identifier property to
secondViewController
.Change the Style property to Modal.
Change the Transition property to Cover Vertical.
Next, we need to modify our view controller to include the prepareForSegue:sender
method that will be responsible for handling transitions between view controllers within the storyboard:
Open the
ViewController.m
implementation file from the...