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.
I would really appreciate if any one could provide any suggestions or sample code.
Thank you in advance !!
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?
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];
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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With