Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created March 31, 2023 03:16
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 laevandus/500d53d410676ff68e20406955b88bc0 to your computer and use it in GitHub Desktop.
Save laevandus/500d53d410676ff68e20406955b88bc0 to your computer and use it in GitHub Desktop.
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