Ever since I updated my device to iOS 8.3, I have not been able to get an interactive transition to complete.
It appears that when I call cancelInteractiveTransition()
or finishInteractiveTransition()
, the completion
block in the animator's completion
block, which contains the line:
transitionContext.completeTransition(!transitionContext.transitionWasCancelled())
is not called at all most of the time. This causes the entire application to stop reacting to touch and rotation events.
I'm using a subclass of UIPercentDrivenInteractiveTransition
. cancelInteractiveTransition()
and finishInteractiveTransition()
are called when its pan gesture recognizer is in the state .Ended
or .Cancelled
.
Is this a bug in iOS 8.3 (since this issue only happened to me after 8.3), or am I doing it wrong?
Try to override animationDidStop and call it from there
override func animationDidStop(anim: CAAnimation!, finished flag: Bool) {
self.transitionContext?.completeTransition(!self.transitionContext!.transitionWasCancelled())
}
I hope that help you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With