Protocol

UIViewControllerContextTransitioning

A set of methods that provide contextual information for transition animations between view controllers.

Declaration

@protocol UIViewControllerContextTransitioning

Overview

Do not 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

containerView

The view that acts as the superview for the views involved in the transition.

Required.

- viewControllerForKey:

Returns a view controller involved in the transition.

Required.

- viewForKey:

Returns the specified view involved in the transition.

Required.

Getting the Transition Frame Rectangles

- initialFrameForViewController:

Returns the starting frame rectangle for the specified view controller’s view.

Required.

- finalFrameForViewController:

Returns the ending frame rectangle for the specified view controller’s view.

Required.

Getting the Transition Behaviors

animated

A Boolean value indicating whether the transition should be animated.

Required.

interactive

A Boolean value indicating whether the transition is currently interactive.

Required.

presentationStyle

Returns the presentation style for the view controller transition.

Required.

Reporting the Transition Progress

- completeTransition:

Notifies the system that the transition animation is done.

Required.

- updateInteractiveTransition:

Updates the completion percentage of the transition.

Required.

- pauseInteractiveTransition

Tells the system to pause the animations.

Required.

- finishInteractiveTransition

Notifies the system that user interactions signaled the completion of the transition.

Required.

- cancelInteractiveTransition

Notifies the system that user interactions canceled the transition.

Required.

transitionWasCancelled

Returns a Boolean value indicating whether the transition was canceled.

Required.

Getting the Rotation Factor

targetTransform

Returns a transform indicating the amount of rotation being applied during the transition.

Required.

Constants

UITransitionContextViewControllerKey

The keys you use to identify the view controllers involved in a transition.

UITransitionContextViewKey

The keys you use to identify the views involved in a transition.

Relationships

Inherits From

See Also

Non-Interactive Transitions

UIViewControllerAnimatedTransitioning

A set of methods for implementing the animations for a custom view controller transition.