SwiftUI: Difference between revisions
Jump to navigation
Jump to search
Line 58: | Line 58: | ||
* [https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-views-in-a-loop-using-foreach Create view using ForEach] | * [https://www.hackingwithswift.com/quick-start/swiftui/how-to-create-views-in-a-loop-using-foreach Create view using ForEach] | ||
* [https://stackoverflow.com/questions/56487323 <code>{H|V}Stack</code> height width] | * [https://stackoverflow.com/questions/56487323 <code>{H|V}Stack</code> height width] | ||
* [https://stackoverflow.com/questions/56462647 HStack Center Alignment] | |||
* [https://www.hackingwithswift.com/books/ios-swiftui/creating-views-in-a-loop Creating views in a loop] | * [https://www.hackingwithswift.com/books/ios-swiftui/creating-views-in-a-loop Creating views in a loop] | ||
* [https://kean.github.io/post/swiftui-layout-system SwiftUI Layout System] | * [https://kean.github.io/post/swiftui-layout-system SwiftUI Layout System] | ||
Line 63: | Line 64: | ||
* [https://stackoverflow.com/questions/56619043 SwiftUI Divider Styles] | * [https://stackoverflow.com/questions/56619043 SwiftUI Divider Styles] | ||
* [https://medium.com/programming-with-swift/create-a-floating-action-button-with-swiftui-4d05dcddc365 Floating Button] | * [https://medium.com/programming-with-swift/create-a-floating-action-button-with-swiftui-4d05dcddc365 Floating Button] | ||
| valign="top" | | |||
|} | |} |
Revision as of 05:15, 1 January 2020
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()
}
}