Content deleted Content added
Copyvio revdel completed (RR) |
Fix syntax whitespace and provide more context |
||
Line 34:
== Examples ==
The following is an example of a simple [["Hello, World!" program|Hello World]] program. The {{code|@main}} attribute defines the entry point into the app. It is standard practice in SwiftUI to separate the application struct and views into different structs, according to the [[Model–view–viewmodel|Model–View–ViewModel]] (MVVM) architectural pattern.<ref>{{Cite book |last=Hudson |first=Paul |title=Swift Design Patterns |publisher=Paul Hudson |year=2018 |language=English}}</ref>{{self-published source inline|date=April 2024}}
<syntaxhighlight lang="swift">
import SwiftUI
Line 46:
}
}
struct ContentView: View {
var body: some View {
Text("Hello, World!")
}
</syntaxhighlight>
|