---
title: extensionContext
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uiviewcontroller/extensioncontext
---

# extensionContext

Returns the extension context of the view controller.

## Declaration

```swift
var extensionContext: NSExtensionContext? { get }
```

## Discussion

Discussion The view controller can check this property to see if it participates in an extension request. If no extension context is set for the current view controller, the system walks up the view controller hierarchy to find a parent view controller that has a non nil extensionContext value.
