code_junkie

How can I change the animation style of a modal UIViewController?

Nov 11th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. [[self navigationController] presentModalViewController:modalViewController animated:YES];
  2.  
  3. [self.navigationController dismissModalViewControllerAnimated:YES];
  4.  
  5. UIViewController *controller = [[[MyViewController alloc] init] autorelease];
  6. UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;
  7. [UIView beginAnimations: nil context: nil];
  8. [UIView setAnimationTransition: trans forView: [self window] cache: YES];
  9. [navController presentModalViewController: controller animated: NO];
  10. [UIView commitAnimations];
  11.  
  12. UIViewController *controller = [[[MyViewController alloc] init] autorelease];
  13. controller.view.alpha = 0.0;
  14. [navController presentModalViewController: controller animated: NO];
  15. [UIView beginAnimations: nil context: nil];
  16. controller.view.alpha = 1.0;
  17. [UIView commitAnimations];
  18.  
  19. modalViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  20. [[self navigationController] presentModalViewController:modalViewController
  21. animated:YES];
  22.  
  23. modalController.view.alpha = 0.0;
  24. [self.view.window.rootViewController presentModalViewController:modalController animated:NO];
  25. [UIView animateWithDuration:0.5
  26. animations:^{modalController.view.alpha = 1.0;}];
Add Comment
Please, Sign In to add comment