<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.1.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ExtensionFoundation",
  "identifier" : "/documentation/ExtensionFoundation/AppExtension",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "ExtensionFoundation"
    ],
    "preciseIdentifier" : "s:19ExtensionFoundation03AppA0P"
  },
  "title" : "AppExtension"
}
-->

# AppExtension

An interface you use to declare the content, structure, and behavior of an app extension.

```
protocol AppExtension
```

## Overview

This type provides the entry point for an app extension, and every app extension must have
a concrete type that adopts it. When a host app launches an app extension, the system looks
for an object that adopts this protocol. The protocol provides default implementations of
the code required to run the app extension.

When adopting this protocol, implement the [`configuration`](/documentation/ExtensionFoundation/AppExtension/configuration-swift.property) property and provide a type
capable of establishing an XPC connection to the host app. If your app extension sends only
data to the host app, and doesn’t provide a UI, provide a type that implements the
[`AppExtensionConfiguration`](/documentation/ExtensionFoundation/AppExtensionConfiguration) protocol. If your extension provides UI elements for the host
app to display, instead provide an instance of the
<doc://com.apple.documentation/documentation/ExtensionKit/AppExtensionSceneConfiguration>
type.

## Topics

### Creating an app extension

[`init()`](/documentation/ExtensionFoundation/AppExtension/init())

Initializes the app extension and prepares it to run.

### Configuring the app extension

[`configuration`](/documentation/ExtensionFoundation/AppExtension/configuration-swift.property)

The configuration details for this app extension.

[`Configuration`](/documentation/ExtensionFoundation/AppExtension/Configuration-swift.associatedtype)

A type that manages configuration data for an app extension.

### Running the main event loop

[`main()`](/documentation/ExtensionFoundation/AppExtension/main()-5zfjx)

The main entry point for an app extension that doesn’t present any UI.

[`main()`](/documentation/ExtensionFoundation/AppExtension/main()-w0u9)

The main entry point for an app extension that doesn’t present any UI.



---

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)