0PricingLogin
SwiftUI Academy · Lesson

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

  1. Installing Xcode & Creating a Project
  2. Anatomy of a SwiftUI App File
  3. The Live Preview Canvas
  4. Running on Simulator & Device
← Back to SwiftUI Academy