Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do the page curl like in storybook app in iPad

I am working on a storybook app, i want to do the page curl like in the following video.

Demo Video

Can anyone tell me how to do exactly like this.

Update:

I want this page curling to support iOS 4.3+. UIPageViewController will work only on iOS 6.

like image 367
surendher Avatar asked Jan 18 '13 05:01

surendher


3 Answers

You might want to consider UIPageViewController. It is quite useful in creating apps which use page curling animations. Here is the documentations link.

like image 145
Zen Avatar answered Nov 18 '22 00:11

Zen


You can make use of the UIView's animation effect for this. I guess this should help you

[UIView beginAnimations:@"Curl" context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:contentView cache:YES];
[UIView commitAnimations];

where the contentView is the view where you are applying the animation. By varying the duration and animation curve you can modify your animation effect.

like image 2
Meera Avatar answered Nov 18 '22 00:11

Meera


There are two ways of doing it:

  1. The hard way, implement everything yourself (from scratch, with layers and masks and transforms and gradients) and a lot of headache.

  2. the Easy way, read the documentation for UIPageViewController as suggested by @Zen. Its very useful and gives you the exact animation that you want (as shown in video). Or, using some third party code.

If you dont't have time constraint, then I will say, go the first way. You will learn a lot.

Cheers, have fun :)

EDIT

Here is the link to a sample app:

https://www.dropbox.com/s/x4qo2igrzvnkj16/CurlAnimationProject.zip

check it and tell me what you think.

like image 1
devluv Avatar answered Nov 18 '22 02:11

devluv