Skip to content

Instantly share code, notes, and snippets.

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