Created
January 26, 2015 05:26
-
-
Save Zhukn1/75064415269a784571d3 to your computer and use it in GitHub Desktop.
Last completion block not called.
This file contains 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
- (void)perform { | |
UIViewController *sourceController = self.sourceViewController; | |
UIViewController *destinationController = self.destinationViewController; | |
UIView *destView = destinationController.view; | |
destView.alpha = 0; | |
[sourceController.view addSubview:destView]; | |
destView.frame = CGRectMake(0, 0, | |
CGRectGetWidth(sourceController.view.bounds), | |
CGRectGetHeight(sourceController.view.bounds)); | |
destView.transform = CGAffineTransformMakeScale(0.05, 0.05); | |
CGPoint originalCenter = destinationController.view.center; | |
destinationController.view.center = self.originatingPoint; | |
[UIView animateWithDuration:0.4 | |
delay:0.0 | |
options:UIViewAnimationOptionCurveEaseInOut | |
animations:^{ | |
destView.alpha = 1; | |
destView.transform = CGAffineTransformMakeScale(1, 1); | |
destinationController.view.center = originalCenter; | |
} | |
completion:^(BOOL finished){ | |
[sourceController presentViewController:destinationViewController | |
animated:NO | |
completion:^{ | |
[destView removeFromSuperview]; | |
}]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment