Skip to content

Instantly share code, notes, and snippets.

@meyusufdemirci
Last active June 9, 2022 21:01
Show Gist options
  • Save meyusufdemirci/50934e9b0cb6cf7d060d061a2f4e468d to your computer and use it in GitHub Desktop.
Save meyusufdemirci/50934e9b0cb6cf7d060d061a2f4e468d to your computer and use it in GitHub Desktop.
What is New in SwiftUI, WWDC 22 Article
let vehicles: [Vehicle] = [
.init(name: "Car", iconName: "car"),
.init(name: "Bus", iconName: "bus"),
.init(name: "Airplane", iconName: "airplane")
]
var body: some View {
NavigationStack {
List(vehicles) { vehicle in
NavigationLink(value: vehicle) {
Label(vehicle.name, systemImage: vehicle.iconName)
}
}
.navigationDestination(for: Vehicle.self) { vehicle in
VehicleDetailView(vehicle: vehicle)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment