Skip to content

Instantly share code, notes, and snippets.

@nbhasin2
Last active April 3, 2023 01:13
Show Gist options
  • Save nbhasin2/ece8fcf94fec4e86f6508d434e717daa to your computer and use it in GitHub Desktop.
Save nbhasin2/ece8fcf94fec4e86f6508d434e717daa to your computer and use it in GitHub Desktop.
NavigationStack & NavigationView: CarDetailView and CarType Example
struct CarDetailView: View {
let car: Car
var body: some View {
VStack {
Text("Car name: \(car.rawValue)")
}
.navigationTitle("\(car.rawValue)")
}
}
struct CarTypeView: View {
let carType: CarType
var body: some View {
VStack {
Text("Car type: \(carType.rawValue)")
}
.navigationTitle("\(carType.rawValue)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment