<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewControllerContextTransitioning/view(forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIViewControllerContextTransitioning(im)viewForKey:"
  },
  "title" : "view(forKey:)"
}
-->

# view(forKey:)

Returns the specified view involved in the transition.

```
func view(forKey key: UITransitionContextViewKey) -> UIView?
```

## Parameters

`key`

The key identifying the view you want. For a list of possible keys, see `View Transition Keys`.

## Return Value

The view object for the specified key or `nil` if the view could not be found.

## Discussion

The view returned by this method may or may not be the root view of the corresponding view controller. A situation where the views may not be the same is when a system-provided presentation controller installs another view underneath the presented view controller’s view.

---

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)