iOS - Storyboards

Storyboards are presented in iOS 5. When we use storyboards, our implementation focus on should be 5.0 or greater. Storyboards help us make all the displays of an program and interconnect the displays under one interface MainStoryboard.storyboard. It also allows in decreasing the programming of pushing/presenting perspective remotes.

Steps Involved

Step 1. Create only one perspective program and make sure that you choose storyboard checkbox while developing the program.

Step 2. Select MainStoryboard.storyboard where you can find individual perspective operator. Add one more perspective remotes and upgrade the perspective remotes as proven below.


Step 3. Let us now link both the perspective remotes. Right-click on the "show modal" key and move it to the right perspective operator in the remaining part perspective operator as proven below.


Step 4. Choose modal from the three choices proven as proven below.



Step 5. Update ViewController.h as follows −
#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

-(IBAction)done:(UIStoryboardSegue *)seque;

@end
Step 6. Update ViewController.m as follows −
#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad]; 
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(IBAction)done:(UIStoryboardSegue *)seque{
    [self.navigationController popViewControllerAnimated:YES];
}

@end

Step 7. Choose the MainStoryboard.storyboard and right-click on the Quit key in the right part perspective operator, select done and link with the returning key as proven below.


Output

When we run the application in an iPhone device, we'll get the following output −

When we select "show modal", we will get the following output −