0

I'm implementing a UIViewControllerAnimatedTransitioning with a UINavigationControllerDelegate to create a custom push animation. I want the push to look exactly like the slide up animation that presentViewController uses.

I'm currently using a duration of 0.4 seconds and UIViewAnimationOptionCurveEaseOut and it looks pretty darn close to the standard presentViewController animation but I don't want to just trust my eye.

Does anyone know what the animation properties are for presentViewController so that I can make sure I'm mimicking them exactly?

There are reasons why I'm doing a custom push animation instead of just using a modal view controller. Don't want that to distract from the question I've proposed. Thanks in advance!

Adam Langsner
  • 1,276
  • 1
  • 15
  • 23

1 Answers1

0

use this line of code

UIViewController *yourViewController = [[UIViewController alloc]init];

[UIView  beginAnimations: @"Showinfo" context: nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController: yourViewController animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
[UIView commitAnimations];

I used animation duration 0.75 to look like modally view presentation. check this original thread

Community
  • 1
  • 1
Burhan Ahmad
  • 728
  • 5
  • 13