Sure, you possibly can change the struct title and/or the file title, and also you need not make any extra adjustments.
All that’s vital is the @foremost
attribute, and that it’s connected to a struct that conforms to App
.
The Swift compiler robotically appears for sorts with a @foremost
connected, and units the entry level of this system to be the foremost
technique of that.
Within the case of SwiftUI, this may be App.foremost()
, which your conforming struct will get at no cost. When this foremost
technique known as, all of the SwiftUI lifecycle stuff begins up and that is how your SwiftUI app will get began.
Nevertheless, when you’ve got a file referred to as “foremost.swift”, that may robotically be set because the entry level. Placing a @foremost
in that file is an error, so maintain that in thoughts when renaming your information. For extra particulars, see See SE-0281.