I have created a custom segue to create vertical slide animation. It was working fine in iOS7. But it is giving warning and flickering effect at the end of the animation.
Warning Message: Unbalanced calls to begin/end appearance transitions for destinationViewController
Following is my code
-(void)perform{
NSTimeInterval delayinterval = 0.0;
UIViewController *sourceViewController = self.sourceViewController;
UIViewController *destinationViewController = self.destinationViewController;
destinationViewController.view.center = sourceViewController.view.center;
destinationViewController.view.transform = sourceViewController.view.transform;
destinationViewController.view.bounds = sourceViewController.view.bounds;
CGRect destination = destinationViewController.view.frame;
destinationViewController.view.frame = CGRectMake(destination.origin.x, destination.size.height, destination.size.width, destination.size.height);
[sourceViewController.view.superview addSubview:destinationViewController.view];
[UIView animateWithDuration:0.2 delay:delayinterval options:UIViewAnimationOptionTransitionNone animations:^{
CGRect orginator = sourceViewController.view.frame;
sourceViewController.view.frame = CGRectMake(orginator.origin.x, -orginator.size.height, orginator.size.width, orginator.size.height);
destinationViewController.view.frame = orginator;
} completion:^(BOOL finished) {
// remove from temp super view
[destinationViewController.view removeFromSuperview];
if ([self.identifier isEqualToString:@"UnWindCustomSettingsSegue"]){
[sourceViewController dismissViewControllerAnimated:NO completion:NULL];
}else {
[sourceViewController presentViewController:destinationViewController animated:NO completion:NULL];
}
}];
}