开发者

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 UIGestureRecognizers, 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜