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