Storyboard, storyboard tutorial

Source: Internet
Author: User

Storyboard, storyboard tutorial

I. Dynamic code rewriting

1. Generally, the main. storyboard is automatically executed when the program is started.

You can also rewrite it in AppDelegate.

-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions

{

Self. window = [[[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds] autorelease];

// Override point for customization after application launch.

// Use Storyboard to initialize the Root Interface

// UIStoryboard * storyBoard = [UIStoryboard storyboardWithName: @ "MainStoryboard" bundle: nil];

// Self. window. rootViewController = [storyBoard instantiateInitialViewController];

 

2. Call storyboard in xib

-(IBAction) loginBtnClicked :( id) sender {

// Click the login button to switch to the storyboard interface.

UIStoryboard * storyboard = [UIStoryboard storyboardWithName: @ "MainStoryboard" bundle: nil];

 

// Self. view. window. rootViewController = [storyboard instantiateInitialViewController];

// [Self presentModalViewController: [storyboard instantiateInitialViewController] animated: YES];

[Self presentViewController: [storyboard instantiateInitialViewController] animated: YES completion: nil];

[Storyboard release];

}

 

3. storyboard calls storyboard

 

4.

Push segue

Is to press another View Controller Into the stack of the navigation controller. It is usually used with the navigation view controller.
The newly pushed View Controller has a rollback button, which can be returned to the previous layer.

 

Modal segue

Jump to vc

Use javasmseguewithidentifier to switch between ViewController

Http://luckfox.iteye.com/blog/1826416

 

Custom, rarely used

 

Refer:

Http://iaiai.iteye.com/blog/1493956 pity instance cannot download

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.