- iOS - Application Debugging
- iOS - Memory Management
- iOS - Twitter & Facebook
- iOS - Auto Layouts
- iOS - Storyboards
- iOS - GameKit
- iOS - iAd Integration
- iOS - In-App Purchase
- iOS - Accessing Maps
- iOS - File Handling
- iOS - Audio & Video
- iOS - Sending Email
- iOS - SQLite Database
- iOS - Location Handling
- iOS - Camera Management
- iOS - Universal Applications
- iOS - Accelerometer
- iOS - UI Elements
- iOS - Delegates
- iOS - Actions and Outlets
- iOS - First iPhone Application
- iOS - Objective-C Basics
- iOS - Environment Setup
- iOS - Getting Started
- iOS - Home
iOS Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
iOS - Storyboards
Storyboards are introduced in iOS 5. When we use storyboards, our deployment target should be 5.0 or higher. Storyboards help us create all the screens of an apppcation and interconnect the screens under one interface MainStoryboard.storyboard. It also helps in reducing the coding of pushing/presenting view controllers.
Steps Involved
Step 1 − Create a single view apppcation and make sure that you select storyboard checkbox while creating the apppcation.
Step 2 − Select MainStoryboard.storyboard where you can find single view controller. Add one more view controllers and update the view controllers as shown below.
Step 3 − Let us now connect both the view controllers. Right-cpck on the "show modal" button and drag it to the right view controller in the left side view controller as shown below.
Step 4 − Select modal from the three options displayed as shown 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 − Select the MainStoryboard.storyboard and right-cpck on the Exit button in the right side view controller, select done and connect with the back button as shown below.
Output
When we run the apppcation in an iPhone device, we ll get the following output −
When we select "show modal", we will get the following output −
Advertisements