Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created January 22, 2021 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azamsharp/4cd28f3a3fd6170c174d4be4910419f2 to your computer and use it in GitHub Desktop.
Save azamsharp/4cd28f3a3fd6170c174d4be4910419f2 to your computer and use it in GitHub Desktop.
NavigationView {
VStack {
List(customers, id: \.self) { customer in
NavigationLink(
destination: DetailView(customer: customer),
label: {
HStack {
Text(customer)
Spacer()
}.contentShape(Rectangle())
})
}.listStyle(PlainListStyle())
}
.onAppear {
// selectedCustomer = nil
}
.navigationTitle("Customers")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment