Daily iOS
SwiftUI

App entry point

In a SwiftUI app, what does @main mean?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

@main marks the type where the compiler should place the program's entry point (the main function). The App protocol provides a default static main(), so the app starts from the App type that carries this attribute.

Share a question