<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewControllerContextTransitioning",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIViewControllerContextTransitioning"
  },
  "title" : "UIViewControllerContextTransitioning"
}
-->

# UIViewControllerContextTransitioning

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

```
@MainActor protocol UIViewControllerContextTransitioning : NSObjectProtocol
```

## Overview

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`](/documentation/UIKit/UIViewControllerAnimatedTransitioning) or [`UIViewControllerInteractiveTransitioning`](/documentation/UIKit/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(_:)`](/documentation/UIKit/UIViewControllerContextTransitioning/updateInteractiveTransition(_:)), [`finishInteractiveTransition()`](/documentation/UIKit/UIViewControllerContextTransitioning/finishInteractiveTransition()), or [`cancelInteractiveTransition()`](/documentation/UIKit/UIViewControllerContextTransitioning/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.

> Important:
> When defining custom animator objects, always check the value returned by the ``doc://com.apple.uikit/documentation/UIKit/UIViewControllerContextTransitioning/isAnimated`` method to determine whether you should create animations at all. And when you do create transition animations, always call the ``doc://com.apple.uikit/documentation/UIKit/UIViewControllerContextTransitioning/completeTransition(_:)`` method from an appropriate completion block to let UIKit know when all of your animations have finished.

## Topics

### Accessing the transition objects

[`containerView`](/documentation/UIKit/UIViewControllerContextTransitioning/containerView)

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

[`viewController(forKey:)`](/documentation/UIKit/UIViewControllerContextTransitioning/viewController(forKey:))

Returns a view controller involved in the transition.

[`view(forKey:)`](/documentation/UIKit/UIViewControllerContextTransitioning/view(forKey:))

Returns the specified view involved in the transition.

### Getting the transition frame rectangles

[`initialFrame(for:)`](/documentation/UIKit/UIViewControllerContextTransitioning/initialFrame(for:))

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

[`finalFrame(for:)`](/documentation/UIKit/UIViewControllerContextTransitioning/finalFrame(for:))

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

### Getting the transition behaviors

[`isAnimated`](/documentation/UIKit/UIViewControllerContextTransitioning/isAnimated)

A Boolean value indicating whether the transition should be animated.

[`isInteractive`](/documentation/UIKit/UIViewControllerContextTransitioning/isInteractive)

A Boolean value indicating whether the transition is currently interactive.

[`presentationStyle`](/documentation/UIKit/UIViewControllerContextTransitioning/presentationStyle)

Returns the presentation style for the view controller transition.

### Reporting the transition progress

[`completeTransition(_:)`](/documentation/UIKit/UIViewControllerContextTransitioning/completeTransition(_:))

Notifies the system that the transition animation is done.

[`updateInteractiveTransition(_:)`](/documentation/UIKit/UIViewControllerContextTransitioning/updateInteractiveTransition(_:))

Updates the completion percentage of the transition.

[`pauseInteractiveTransition()`](/documentation/UIKit/UIViewControllerContextTransitioning/pauseInteractiveTransition())

Tells the system to pause the animations.

[`finishInteractiveTransition()`](/documentation/UIKit/UIViewControllerContextTransitioning/finishInteractiveTransition())

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

[`cancelInteractiveTransition()`](/documentation/UIKit/UIViewControllerContextTransitioning/cancelInteractiveTransition())

Notifies the system that user interactions canceled the transition.

[`transitionWasCancelled`](/documentation/UIKit/UIViewControllerContextTransitioning/transitionWasCancelled)

Returns a Boolean value indicating whether the transition was canceled.

### Getting the rotation factor

[`targetTransform`](/documentation/UIKit/UIViewControllerContextTransitioning/targetTransform)

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

### Constants

[`UITransitionContextViewControllerKey`](/documentation/UIKit/UITransitionContextViewControllerKey)

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

[`UITransitionContextViewKey`](/documentation/UIKit/UITransitionContextViewKey)

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)