---
title: main()
framework: swiftui
role: symbol
role_heading: Type Method
path: swiftui/app/main()
---

# main()

Initializes and runs the app.

## Declaration

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

## Discussion

Discussion If you precede your App conformer’s declaration with the @main attribute, the system calls the conformer’s main() method to launch the app. SwiftUI provides a default implementation of the method that manages the launch process in a platform-appropriate way.

## See Also

### Running an app

- [init()](swiftui/app/init().md)
