Created
January 23, 2021 18:45
-
-
Save azamsharp/bb87e22134feef2af8afd8bda483a940 to your computer and use it in GitHub Desktop.
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 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