UIViewControllerContextTransitioning
A set of methods that provide contextual information for transition animations between view controllers.
Declaration
@MainActor protocol UIViewControllerContextTransitioning : NSObjectProtocolOverview
Don’t adopt this protocol in your own classes, nor should you directly create objects that adopt this protocol. During a transition, the animator objects involved in that transition receive a fully configured context object from UIKit. Custom animator objects — objects that adopt the UIViewControllerAnimatedTransitioning or UIViewControllerInteractiveTransitioning protocol — should simply retrieve the information they need from the provided object.
A context object encapsulates information about the views and view controllers involved in the transition. It also contains details about the how to execute the transition. For interactive transitions, the interactive animator object uses the methods of this protocol to report the animation’s progress. When the animation starts, the interactive animator object must save a pointer to the context object. Based on user interactions, the animator object then calls the updateInteractiveTransition(_:), finishInteractiveTransition(), or cancelInteractiveTransition() methods to report the progress toward completing the animation. Those methods send that information to UIKit so that it can drive the timing of the animations.
Topics
Accessing the transition objects
Getting the transition frame rectangles
Getting the transition behaviors
Reporting the transition progress
completeTransition(_:)updateInteractiveTransition(_:)pauseInteractiveTransition()finishInteractiveTransition()cancelInteractiveTransition()transitionWasCancelled