We talked in a previous blog about how to use the Dismissviewcontrolleranimation () method to return to iOS, and now we have a more convenient way to implement the return operation after the interface jumps. The unwind Segue is used. The implementation steps are as follows:
(1) Create a button in two Viewcontroller, one as a jump, one as a return, and a link "jump" button to the second Viewcontroller. The overall interface layout is as follows:
(2) in the first Viewcontroller, write a @ibaction-modified close () method, which only needs to be defined and does not require the method body. As follows:
。
(3) Come to storyboard, click the right mouse button drag "back" to the upper right corner of the interface "Exit" icon (the interface above the three icons, respectively, view Controller,first responder,exit). After dragging, the action Segue appears, selecting the close that appears below.
。
。
(4) Run the program, found two interface can successfully jump and return. Do you find this method more fashion than calling Dismissviewcontrolleranimation ()?
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
iOS development uses unwind segue to return