-
-
Save laevandus/500d53d410676ff68e20406955b88bc0 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 FruitList: View { | |
@StateObject var viewModel = ViewModel() | |
var body: some View { | |
NavigationStack { | |
List(viewModel.fruits) { item in | |
NavigationLink(item.name) { | |
Text(verbatim: "Detail view for \(item.name)") | |
} | |
} | |
.navigationTitle("Fruits") | |
.searchable(text: $viewModel.searchText) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment