Skip to content

Instantly share code, notes, and snippets.

@ianiv
Created November 21, 2012 23:10
Show Gist options
  • Save ianiv/4128445 to your computer and use it in GitHub Desktop.
Save ianiv/4128445 to your computer and use it in GitHub Desktop.
UINavigationController custom transitions
// With transitionWithView
[UIView transitionWithView:self.navigationController.view
duration:0.5
options:UIViewAnimationOptionTransitionFlipFromBottom
animations:^{
[self.navigationController pushViewController:viewController animated:NO];
}
completion:nil];
// With CATransition
CATransition *transition = [CATransition animation];
transition.duration = 0.3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:viewController animated:NO];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment