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