1

Can anyone tell the block animation equivalent of this below code snippet?

[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight 
           forView:self.navigationController.view cache:NO];

NextViewController *next = [[NextViewController alloc] 
           initWithNibName:@"NextViewController" bundle:nil];

[self.navigationController pushViewController:next animated:YES];
[next release];
[UIView commitAnimations];
Mat
  • 202,337
  • 40
  • 393
  • 406
Graham Bell
  • 1,139
  • 1
  • 14
  • 30

2 Answers2

13
NextViewController *next = [[NextViewController alloc] initWithNibName:@"NextViewController" bundle:nil];

[UIView transitionWithView:self.navigationController.view 
                  duration:0.75 
                   options:UIViewAnimationOptionTransitionFlipFromRight 
                animations:^{
                 [self.navigationController pushViewController:next animated:NO];
                } 
                completion:nil];
Paul Hunter
  • 4,453
  • 3
  • 25
  • 31
1
UIView: + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion
Oleg Trakhman
  • 2,082
  • 1
  • 17
  • 35