Created
January 27, 2012 19:11
-
-
Save zeedark/1690396 to your computer and use it in GitHub Desktop.
Horizontal flip transition of a modal view with back button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SomeViewController.m | |
// | |
- (IBAction)doShowSomething:(id)sender | |
{ | |
UINavigationController *nav = [[[UINavigationController alloc]init] autorelease]; | |
MyViewController *av = [[[MyViewController alloc] init] autorelease]; | |
[nav pushViewController:av animated:NO]; | |
[nav setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; | |
[nav setModalPresentationStyle:UIModalPresentationCurrentContext]; | |
[self.navigationController presentModalViewController:nav animated:YES]; | |
} | |
// | |
// MyViewController.m | |
// | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UIBarButtonItem *bt = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(doBack:)] autorelease]; | |
self.navigationItem.rightBarButtonItem = bt; | |
} | |
-(IBAction)doBack:(id)sender | |
{ | |
[self dismissModalViewControllerAnimated:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment