Skip to content

Instantly share code, notes, and snippets.

@obyknovenius
Last active March 20, 2016 02:41
Show Gist options
  • Save obyknovenius/b87b8231980d7922104d to your computer and use it in GitHub Desktop.
Save obyknovenius/b87b8231980d7922104d to your computer and use it in GitHub Desktop.
#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