Anatomy of a SwiftUI App File
Understand @main, App, WindowGroup, and ContentView.
The App File
Every SwiftUI project has a file named after your app, like MyFirstApp.swift. This app file is the true entry point where your whole app begins. 📱
The @main Marker
The @main attribute tells Swift exactly where your program starts. iOS launches your app by running the type marked with it.
@main
struct MyFirstApp: App {
}All lessons in this course
- Installing Xcode & Creating a Project
- Anatomy of a SwiftUI App File
- The Live Preview Canvas
- Running on Simulator & Device