Skip to content

Instantly share code, notes, and snippets.

@erenkabakci
Created April 6, 2023 10:32
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 erenkabakci/0803c420e0d626436402215a1791b6c7 to your computer and use it in GitHub Desktop.
Save erenkabakci/0803c420e0d626436402215a1791b6c7 to your computer and use it in GitHub Desktop.
final class DepotViewModel: ObservableObject {
@Published searchPresented: Bool = false
func presentSearch() {
showSearch = true
}
}
struct DepotOverviewView: View {
@StateObject var viewModel: DepotViewModel
var body: View {
SomeView
.sheet(isPresented: $viewModel.searchPresented) { // using auto binidng with $ out of the box
SBNavigationView(path: .constant(Routing.financeRouter.path)) {
SearchView(viewModel: viewModel.searchViewModel){
viewModel.presentSearch()
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment