Making an interactive dismissal transition

Implementing an interactive transition requires a bit more work than the non-interactive presentation animation, and the way it works is also somewhat harder to grasp. For the non-interactive transition, transitioningDelegate simply returns an animation controller from animationController(forPresented:presenting:source:).

To implement an interactive dismiss transition, two methods should be implemented. These two methods work together to make the interactive animation happen. The first method is animationController(forDismissed:). This method will return an object that performs and controls the interactive animation, similar to the animation controller you implemented before.

However, to make the ...

Get Mastering iOS 12 Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.