简体   繁体   中英

changing transition of swipe gesture recognizers

I've set up some swipe gesture recognizers in the storyboard to move between view controllers. There are 4 view controllers, swipe left in 1 to go to 2, swipe left in 2 to go to 3 or swipe right in 2 to go back to one, etc. Everything functions just fine, but when I swipe right in one of the views to go back to the previous one, the view transitions in from right side of the screen instead of from the left. When swiping left to move through the pages it looks fine and completely natural, but when swiping right I'd like to be able to tell it which direction the new view controller should transition in from. I don't see any way to do this with the storyboarding and am not sure how I would do it programatically.

If you are doing transitions using segues, then the right swipe needs to be connected to an unwind segue. You shouldn't use a push to go "backwards" in the sequence of controllers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM