Changing views by swiping
i am a newbie in Cocoa/开发者_开发问答Objective-C so I hope you can help me with this question:
I have two View Controllers in two different xib's and i want to switch between these with a swipe of a finger on the screen.
Can anyone give me an advise please:)
Depending on what you to achieve with switching between the views with a swipe, there are a few ways to do it.
Here are a few that come to mind:
UIScrollView with those views as subviews. You can set the Scroll View to paging mode and it handles all swiping for you.
Using
UIGestureRecognizer
s, particularly the UISwipeGestureRecognizer. Add it to both views and create a "master" class that decides what happens when such gesture is performed by the user.
精彩评论