29.9 Adding Navigation to the List
The next step in this tutorial is to return to the List view in the ContentView.swift file and implement navigation so that selecting a row displays the detail screen populated with the corresponding car details.
With the ContentView.swift file loaded into the code editor, locate the ListCell subview declaration and embed the HStack in a NavigationLink with the CarDetail view configured as the destination, making sure to pass through the selected car object:
struct ListCell: View {
var car: Car
var body: some View {
NavigationLink(destination: CarDetail(selectedCar: car)) {
HStack {
...