@main
struct MyNewStruct : App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Xcode 12 shipped with Swift 5.3 which introduced the @main
attribute.The @main attribute means this structure contains the entry point for the app. The App protocol takes care of generating the static main function that actually runs. When the app start, it displays this instance of ContentView, which is defined in the ContentView file. It’s a struct that conforms to the View protocol.
Leave a Reply