iOS development uses unwind segue to return

Source: Internet
Author: User

We talked in a previous blog about how to use the Dismissviewcontrolleranimation () method to return to iOS, and now we have a much more convenient way to implement the return operation after the interface jumps. The unwind Segue is used. The detailed implementation process is as follows:

(1) Create a button in two Viewcontroller respectively. One as a jump. One as a return, and the link "jump" button to the second Viewcontroller. The overall interface layout such as the following:



(2) in the first Viewcontroller, write a @ibaction-modified close () method that simply needs to be defined and does not require a method body. For example, the following:

。


(3) came to the storyboard. Click the right mouse button to drag the "Back" button to the "Exit" icon in the upper right corner of the interface (the interface has three icons, respectively, the View Controller.) First Responder. Exit).

After dragging, the action Segue appears, select the following close to appear.

。


。


(4) Execution of the program, found that two interface can successfully jump and return.

Is it found that such a method is more fashion than calling Dismissviewcontrolleranimation ()?


GitHub home: https://github.com/chenyufeng1991.

Welcome to visit us!


iOS development uses unwind segue to return

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.