Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

iOS Storyboards


May 21, 2021 iOS Development Manual


Table of contents


IOS Storyboards


Brief introduction

Storyboards is only described in iOS 5, and when we use Storyboards, the deployment target should be iOS 5.0 or later.

Storyboards help us understand the visual flow of the picture in the interface for

Create all application screens under MainStoryboard.storyboard.

The instance step

1. Create a style view application and select the storyboard check box when you create the application.

2. Choose MainStoryboard.storyboard, where you can find a single view controller. Add a view controller and update the view controller, as shown below

iOS Storyboards

3. Connect the two view controllers. Right-click the show mode button and drag it to the right-view controller in the left view controller, as shown in the following image:

iOS Storyboards

4. Now select mode (mode) from the three display options shown below

iOS Storyboards

5. Update ViewController.h as follows

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

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

@end

6. Update the ViewController .m as shown below

#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

7. Select "MainStoryboard.storyboard" and right-click the "Exit" button to select and connect the back button in the right view controller, as shown in the following image

iOS Storyboards

Output

Run the app on your iPhone device and get the following output

iOS Storyboards

Now, select the display mode and you'll get the output below

iOS Storyboards