Created
July 30, 2012 11:35
-
-
Save arielelkin/3206340 to your computer and use it in GitHub Desktop.
Custom Segue to slide a view controller from the top
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
-(void)perform{ | |
UIViewController *splashScreen = self.sourceViewController; | |
UIViewController *mainScreen = self.destinationViewController; | |
[splashScreen.view addSubview:mainScreen.view]; | |
mainScreen.view.center = CGPointMake(mainScreen.view.center.x, mainScreen.view.center.y-600); | |
[UIView animateWithDuration:1 | |
animations:^{ | |
mainScreen.view.center = CGPointMake(mainScreen.view.center.x, [[UIScreen mainScreen] bounds].size.height/2); | |
} | |
completion:^(BOOL finished){ | |
[splashScreen presentModalViewController:mainScreen animated:NO]; | |
[[splashScreen.view.subviews lastObject] removeFromSuperview]; | |
} | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment