Presenting UIViewController Modally with Transition Effects

No Comments

These are a few ways of how to present UIViewController modally with transition effects.

UIViewController *controller = [[[MyViewController alloc] init] autorelease];

UIViewAnimationTransition trans = UIViewAnimationTransitionCurlUp;

[UIView beginAnimations: nil context: nil];

[UIView setAnimationTransition: trans forView: [self window] cache: YES];

[navController presentModalViewController: controller animated: NO];

[UIView commitAnimations];

UIViewController *controller = [[[MyViewController alloc] init] autorelease];

controller.view.alpha = 0.0;

[navController presentModalViewController: controller animated: NO];

[UIView beginAnimations: nil context: nil];

controller.view.alpha = 1.0;

[UIView commitAnimations];

MyViewController *controller = [[MyViewController alloc] initWithNibName: @”MyTableView” bundle: nil];

controller.delegate = self;

controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

[self presentModalViewController: controller animated: YES];

[controller release];

Comments are closed.