Reputation: 2729
In my application, I have a screen with some information, belongs to specified date. I want to make a swipe effect, to drag screen to left and right, to change dates.
I think, I should create 2 UIView (one with "tomorrow" date and second one with "yesterday").
How can I make effect, when I start do drag, to move both view controlles, that one start disappear out from screen, and another start to appear, like we turn over photos in standard applications?
Thank you.
Upvotes: 0
Views: 257
Reputation: 1409
Use a UIScrollView. Set up your UIScrollView with paging and then set a content size...
yourScrollView.contentSize = CGSizeMake(320 * numberOfPages, 100);
If you need to know which view the user is on use "scrollViewDidScroll:" to figure out which page they are viewing.
Upvotes: 1
Reputation: 8309
There is a library called iCarousel. It does exactly what you are asking for amd saves a lot of trouble by taking care of all the animation/gestural coding. Use it.
Upvotes: 1