Contents

extensionContext

For a view controller that is part of an app extension, the app extension context.

Declaration

var extensionContext: NSExtensionContext? { get }

Discussion

If the view controller is not part of an app extension, the value of this property is nil.

By checking for nil you can employ this method to determine whether the view controller is part of an app or an app extension, for the purpose of conditionalizing your view controller implementation. Refer to NSExtensionContext for information about the extension context.

See Also

Configuring an App Extension View Controller