IOS development-Implementation of storyboard navigation between multiple viewcontrollers

Source: Internet
Author: User

IOS sdk6/xcode4.5 added a lot of new functions in storyboad for Visual Development page layout, navigation is more convenient, the following describes the implementation of various navigation.

1. You do not need to delete the default viewcontroller before xcode4, and then drag a navigation controller to implement navigation. Select the default viewcontroller and select Editor-embed in-

2. The simplest navigation method is next and back. You only need to press and hold the CTR to drag the line directly. It is best to enter the storyboard segue-Identifier value here.CodeUsed in

The Identifier value can be used in two places.

1. Page switching is convenient for value passing. How is the code?

2. If a page has a navigation path, you need to use the code to determine which target viewcontroller to navigate to, that is, which identifier to execute. The Code is as follows:

3. Custom navigation, which is provided by default, include push, modal, popover, replace, and custom. You can customize the class implementation.

The following code defines a back function Navigation:

4. return any viewcontroller, which is officially called unwind segues. If you want a viewcontroller to directly navigate back from any other viewcontroller, you only need to rewrite the following method under this viewcontroller:

As long as you have rewritten the-(ibaction) Name :( uistoryboardsegue *) segue in each viewcontroller, all your implementation methods will appear when you drag the line directly to the exit icon, if you select a method, the viewcontroller that implements this method is returned.

Basically, I hope it will be helpful for beginners.

 

 

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.