Wednesday, 8 April 2015

Swipe gesture between view controllers (navigation controller)

with Navigation controller, if you want implement swipe interaction to popup view to previous view, you can:


1. add swipe gesture onto the second view:


2. set the gesture to "right":



3.to handle the swipe action, there are two ways:

first solution: (swipe action)




second solution: (gesture delegate)



You don't have to  implement UIGestureRecognizerDelegate, IOS will still call gesture delegate functions.

there are several function of this delegate you can use, I don't know which is the right one. please read the api doc. But my code works.

So my personal recommendation is  the first solution.






No comments:

Post a comment