---
title: main()
framework: extensionfoundation
role: symbol
role_heading: Type Method
path: extensionfoundation/appextension/main()-5zfjx
---

# main()

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

## Declaration

```swift
@MainActor @preconcurrency static func main() throws
```

## Discussion

Discussion Don’t call this method directly. When the host launches your app extension in a new process, the system calls this method to create your custom AppExtension type and prepare your extension for requests from the host app.

## See Also

### Running the main event loop

- [main()](extensionfoundation/appextension/main()-w0u9.md)
