Last active
April 3, 2023 01:13
-
-
Save nbhasin2/ece8fcf94fec4e86f6508d434e717daa to your computer and use it in GitHub Desktop.
NavigationStack & NavigationView: CarDetailView and CarType Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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