Created
March 20, 2016 02:40
-
-
Save obyknovenius/68b6f0f0c97e933b6396 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
#import "LoginSegue.h" | |
@implementation LoginSegue | |
- (void)perform | |
{ | |
UIViewController *sourceViewController = self.sourceViewController; | |
UIViewController *destinationViewController = self.destinationViewController; | |
UIWindow *window = [[[UIApplication sharedApplication] delegate] window]; | |
window.rootViewController = destinationViewController; | |
[window addSubview:sourceViewController.view]; | |
[UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionCurveEaseInOut animations:^{ | |
CGRect sourceViewFrame = sourceViewController.view.frame; | |
sourceViewFrame = CGRectOffset(sourceViewFrame, 0.0f, CGRectGetHeight(sourceViewFrame)); | |
sourceViewController.view.frame = sourceViewFrame; | |
} completion:^(BOOL finished) { | |
[sourceViewController.view removeFromSuperview]; | |
}]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment