Skip to content

Instantly share code, notes, and snippets.

@nbhasin2
Created April 3, 2023 00:15
Show Gist options
  • Save nbhasin2/2ca628d61a0418d22ee73468ab716011 to your computer and use it in GitHub Desktop.
Save nbhasin2/2ca628d61a0418d22ee73468ab716011 to your computer and use it in GitHub Desktop.
NavigationView: NavContentView Example
struct NavContentView: View {
let cars: [Car]
let viewType: ViewType = .navigationView
var body: some View {
NavigationView {
List(cars) { car in
NavigationLink(car.rawValue) {
CarDetailView(car: car)
}
}
.navigationBarTitleDisplayMode(.inline)
.navigationTitle(viewType.title)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment