SwiftUI Essentials
⭐️
時間╱主題
程式碼
// declarative views
Text("Whiskers")
Image(systemName: "cat.fill")
Button("Give Treat") { /* action */ }// layout (container view)
HStack {
Label("Whiskers", systemImage: "cat.fill")
Spacer()
Text("Tightrope walking")
}// container view (5:33)
HStack {
Label("Whiskers", systemImage: "cat.fill")
Spacer()
Text("Tightrope walking")
}PetRowView(pet: model.pet(named: "Whiskers"))
PetRowView(pet: model.pet(named: "Roofus"))
PetRowView(pet: model.pet(named: "Bubbles"))Views
Data Types
App Definition
Last updated