I have a class which supports UIViewControllerAnimatedTransitioning
.
Within is a func named
func animateTransition(using transitionContext: UIViewControllerContextTransitioning)
Within that, I’m performing an animation, and doing this:
UIView.animate(withDuration: totalDuration) {
fromVC.view.alpha = 0
} completion: { success in
transitionContext.completeTransition(success)
}
I’m passing the boolean from the animation completion block into completeTransition
. I’ve seen it both ways online, but I’ve seen a lot more people ignore that success
value, and just pass in !transitionContext.transitionWasCancelled
.
So, the question is, what am I misinterpreting about this value? It seems that the success
value has a different meaning than what is passed into completeTransition
, but I’m having trouble understanding that meaning.