Created
April 6, 2023 10:32
-
-
Save erenkabakci/0803c420e0d626436402215a1791b6c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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