PageTurn Animation on iPhone

How to make page rotation animation like the Stanza app?

I used to, but this is not the animation I'm looking for.

   [CATransaction begin];
   CATransition *animation = [CATransition animation];

   [animation setType:(prevPage ? @"pageUnCurl" : @"pageCurl")];

   [animation setDuration:0.7f];
   [animation setFillMode: ( prevPage ? kCAFillModeBackwards : kCAFillModeForwards )];
   [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
   [[self layer] addAnimation:animation forKey:@"transitionViewAnimation"];
   [CATransaction commit];

thanks

+3
source share
1 answer
[UIView beginAnimations:@"yourAnim" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag];
...
[UIView commitAnimations];

This makes the page curl animation. For flip use constant UIViewAnimationTransitionFlipFromLeftor UIViewAnimationTransitionFlipFromRight.

+3
source

Source: https://habr.com/ru/post/1721774/


All Articles