i think the solution provided in the challenge is not working well: after the interactive pop animation of DetailsViewController finishes, the animation seems to carry on for a few more seconds, giving the impression to the user that the app froze.
I resolved the above issue by making the following changes in RevealAnimator.swift:
“At this point the custom pop transition should be mostly functional. You are using view animations for your pop transition, but view animations don’t need beginTime or completionSpeed to be adjusted. Ensure you don’t modify these properties when the animator operation is .pop.”
In restart(forFinishing:), I wrapped beginTime with a condition like this:
if operation == .push { transitionLayer?.beginTime = CACurrentMediaTime() }
And inside the if interactive { … } block inside animateTransition(using:), I also wrapped speed with a condition:
if operation == .push { transitionLayer.speed = 0 }
It works well. However, I still cannot figure out why we don’t need beginTime and speed when the operation is .pop.
Note: It feels like this extra work for layer animations is a UIKit bug; if you don’t use layer animations in the transition, you don’t have to do all this messing about, but under the hood the transition is doing the same sort of thing to make the view animations scrub back and forth.
Maybe implementing custom interactive transition instead of using UIPercentDrivenInteractiveTransition would’ve been a better option for this app.