<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIViewController/definesPresentationContext",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIViewController(py)definesPresentationContext"
  },
  "title" : "definesPresentationContext"
}
-->

# definesPresentationContext

A Boolean value that indicates whether this view controller’s view is covered when the view controller or one of its descendants presents a view controller.

```
var definesPresentationContext: Bool { get set }
```

## Discussion

When using the [`UIModalPresentationStyle.currentContext`](/documentation/UIKit/UIModalPresentationStyle/currentContext) or [`UIModalPresentationStyle.overCurrentContext`](/documentation/UIKit/UIModalPresentationStyle/overCurrentContext) style to present a view controller, this property controls which existing view controller in your view controller hierarchy is actually covered by the new content. When a context-based presentation occurs, UIKit starts at the presenting view controller and walks up the view controller hierarchy. If it finds a view controller whose value for this property is <doc://com.apple.documentation/documentation/Swift/true>, it asks that view controller to present the new view controller. If no view controller defines the presentation context, UIKit asks the window’s root view controller to handle the presentation.

The default value for this property is <doc://com.apple.documentation/documentation/Swift/false>. Some system-provided view controllers, such as [`UINavigationController`](/documentation/UIKit/UINavigationController), change the default value to <doc://com.apple.documentation/documentation/Swift/true>.

---

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)