SwiftUI: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "==References== * [https://developer.apple.com/tutorials/swiftui/creating-and-combining-views Creating and Combining Views] * [https://developer.apple.com/tutorials/swiftui/ S...")
 
No edit summary
Line 1: Line 1:
==ContentView==
<source lang="swift">
import SwiftUI
struct ContentView: View {
    var body: some View {
        VStack(alignment: .leading) {
            Text("Turtle Rock")
                .font(.title)
            HStack {
                Text("Joshua Tree National Park")
                    .font(.subheadline)
                Spacer()
                Text("California")
                    .font(.subheadline)
            }
        }
        .padding()
    }
}
struct ContentView_Preview: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
</source>
==References==
==References==
* [https://developer.apple.com/tutorials/swiftui/creating-and-combining-views Creating and Combining Views]
* [https://developer.apple.com/tutorials/swiftui/creating-and-combining-views Creating and Combining Views]
* [https://developer.apple.com/tutorials/swiftui/ SwiftUI Essentials]
* [https://developer.apple.com/tutorials/swiftui/ SwiftUI Essentials]

Revision as of 22:08, 14 December 2019

ContentView

import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack(alignment: .leading) {
            Text("Turtle Rock")
                .font(.title)
            HStack {
                Text("Joshua Tree National Park")
                    .font(.subheadline)
                Spacer()
                Text("California")
                    .font(.subheadline)
            }
        }
        .padding()
    }
}

struct ContentView_Preview: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

References