iOS Development memo: Enable multiple storyboard jumps

Source: Internet
Author: User

iOS projects can co-locate pages of the same orchestration into a single storyboard, and the project will inevitably contain multiple stroryboard that can be used to jump through the different business process pages of the project.

Implementation ideas:

1, add two storyboard to project (projects);

2, in the first storyboard, delete the original scene, add a Navigationcontroller again, and then add a button to any view Controller scene. and add a button to the Touchupinside event;

The following code is added to the 3,touchupinside event:

1 uistoryboard *secondstroyboard=[uistoryboard storyboardwithname:@ "Storyboard2"  Bundle:nil]; 2     3 uiviewcontroller *test2obj=[secondstroyboard instantiateviewcontrollerwithidentifier:@ "  Test2"]; 4 5 [Self.navigationcontroller pushviewcontroller:test2obj Animated:no];

Simply analyze the code:

First, you need to specify Uistoryboard;

Next, instantiate a Uiviewcontroller object (where "Test2" is the storyboardid of Viewcontroller);

Finally, use Self.navigationcontroller to jump to the specified storyboard page.

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.