Created
November 12, 2014 14:10
-
-
Save spotlessicode/1a432d1822ca400cdeed to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| { | |
| UIView *sourceView = ((UIViewController *)self.sourceViewController).view; | |
| UIView *destinationView = ((UIViewController *)self.destinationViewController).view; | |
| UIWindow *window = [[[UIApplication sharedApplication] delegate] window]; | |
| destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y - destinationView.center.y); | |
| [window insertSubview:destinationView aboveSubview:sourceView]; | |
| [UIView animateWithDuration:0.4 | |
| animations:^{ | |
| destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y); | |
| sourceView.center = CGPointMake(sourceView.center.x, 0 + 2*destinationView.center.y); | |
| } | |
| completion:^(BOOL finished){ | |
| [[self sourceViewController] presentViewController:[self destinationViewController] animated:NO completion:nil]; | |
| }]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment