Can I "twist" a page on popViewControllerAnimated?

I can curl up with the view controller using this code:

[UIView beginAnimations:@"animation" context:nil]; [self.navigationController pushViewController:page animated:NO]; [UIView setAnimationDuration:1]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO]; [UIView commitAnimations]; 

but I cannot collapse the last page as follows:

 [UIView beginAnimations:@"animation" context:nil]; [self.navigationController popViewControllerAnimated:NO]; [UIView setAnimationDuration:1]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO]; [UIView commitAnimations]; 

any idea why not? I just really want to "flip" the animation (as if the sticker was removed to show the "push'ed view controller" and get stuck when they click the button).

thanks

+2
source share
2 answers

Well, my old answer was completely wrong ... the problem is that you expose the view controller before setting the transition view. If you change the code to this:

 [UIView beginAnimations:@"animation" context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO]; [self.navigationController popViewControllerAnimated:NO]; [UIView commitAnimations]; 

it works great

+4
source

Using OpenGL or many complex CoreAnimation processes, I'm sure you could, but it would be very difficult to do something like this. Something That Can Help You: A simple book application written entirely with CoreAnimation

+1
source

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


All Articles