Skip to content

Instantly share code, notes, and snippets.

@spotlessicode
Created November 12, 2014 14:42
Show Gist options
  • Save spotlessicode/f815f2556db753c87571 to your computer and use it in GitHub Desktop.
Save spotlessicode/f815f2556db753c87571 to your computer and use it in GitHub Desktop.
//in MyCustomUnwindSegue.m
// 1. beloveSubview
[window insertSubview:destinationView belowSubview:sourceView];
// instead of aboveSubview
[window insertSubview:destinationView aboveSubview:sourceView];
//2. dismiss view
[[self destinationViewController] dismissViewControllerAnimated:NO completion:nil];
// instead of present
[[self sourceViewController] presentViewController:[self destinationViewController] animated:NO completion:nil];
//3. y cordinate change
// MyCustomSegue.m animated from:
destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y - destinationView.center.y);
// to:
destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y);
sourceView.center = CGPointMake(sourceView.center.x, 0 + 2*destinationView.center.y);
// MyCustomUnwindSegue.m animated from:
destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y + destinationView.center.y);
// to:
destinationView.center = CGPointMake(sourceView.center.x, sourceView.center.y);
sourceView.center = CGPointMake(sourceView.center.x, 0 - 2*destinationView.center.y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment