Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone : How to implement the page flip effect without curl?

I need to implement the page flip effect in an iOS app. But the the effect should not curl the page like it does with UIPageViewController and some other third party libraries that I have checked . The page should be a rigid one as its the page of a greeting card and not the book. I have to implement something as in the below image.

enter image description here

I would really appreciate if any one could provide any suggestions or sample code.

Thank you in advance !!

like image 746
Bharat Jagtap Avatar asked Apr 25 '13 06:04

Bharat Jagtap


3 Answers

You need to look at how Core Foundation makes 3D Transformations.

The answer to this post has all the links you should need.

How is CATransform3DMakeRotation used?

like image 55
Dev2rights Avatar answered Sep 19 '22 15:09

Dev2rights


you can do this:

[UIView beginAnimations:@"View Flip" context:nil]; 
[UIView setAnimationDuration:0.3];
[UIView setAnimationCurve:UIViewAnimationTransitionFlipFromLeft];
[UIView setAnimationTransition:
UIViewAnimationTransitionCurlUp forView:self.view cache:NO];
[UIView commitAnimations];
like image 23
Dima Avatar answered Nov 02 '22 20:11

Dima


This will be helpful for you.

-(void) animateMe:(UIViewAnimationTransition)style
{
   [self playCardSound];
   [UIView beginAnimations:@"flipview" context:nil];
   [UIView setAnimationDuration:0.5];
   [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
   [UIView setAnimationTransition: style forView:self.view cache:YES];
   [UIView commitAnimations];
}

Call it like:

[self animateMe:UIViewAnimationTransitionFlipFromLeft];
[self animateMe:UIViewAnimationTransitionFlipFromRight];
like image 1
Shardul Avatar answered Nov 02 '22 18:11

Shardul