This video shows the issue I am having. http://www.youtube.com/watch?v=C9od_2KZAbs
I am attempting to create a custom push interactive transition using a UIPanGestureRec
As of iOS 7.1, I can reproduce this in simulator but not on an actual device. Anyway, there appears to be a workaround:
self.interactiveTransitionAnimator.completionSpeed = 0.999;
There is a radar for this bug: rdar://14675246
I've got an example on github that works without the glitch. Let me know if you have further questions.
What happens if you call the [transitionContext completeTransition:YES];
immediately after calling finishInteractiveTransition
like this:
else if (gestureRecogznier.state == UIGestureRecognizerStateEnded) {
if ([gestureRecogznier velocityInView:self.view].x < 0) {
[self.interactiveTransitionAnimator finishInteractiveTransition];
[transitionContext completeTransition:YES];
} else {
[self.interactiveTransitionAnimator cancelInteractiveTransition];
}
self.interactiveTransitionAnimator = nil;
}
Or, as matt observed here, you can also either defer the completeTransition
or drive the custom interaction controller yourself:
I've seen something similar. I have two possible workarounds. One is to use delayed performance in the animation completion handler:
} completion:^(BOOL finished) { double delayInSeconds = 0.1; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ BOOL cancelled = [transitionContext transitionWasCancelled]; [transitionContext completeTransition:!cancelled]; }); self.interacting = NO; }];
The other possibility is: don't use percent-drive animation! I've never had a problem like this when driving the interactive custom animation myself manually.