Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created January 23, 2021 18:45
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/bb87e22134feef2af8afd8bda483a940 to your computer and use it in GitHub Desktop.
Save azamsharp/bb87e22134feef2af8afd8bda483a940 to your computer and use it in GitHub Desktop.
struct ContentView: View {
let customers = ["Alex", "Mary", "John"]
@State var selectedCustomer: String?
var body: some View {
NavigationView {
VStack {
// get the selected customer
CustomerListView(customers: customers) { (customer) in
selectedCustomer = customer
}
// only display the customers
CustomerListView(customers: customers)
}
.navigationTitle("Customers")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment