Best way to provide ViewModel to NavigationDestination #94
Unanswered
marikletko
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I have a question regarding NavigationDestination
I have the following ManagePortfolioViewModel class that has Destination enum inside
What i'm trying to do is to let ManagePortfolioViewModel be used inside CreatePortfolioBottomSheetView as @ObservedObject, I believe it's not the best practice to pass ManagePortfolioViewModel to Destination enum, so I'm trying to fine the best way.
As I know If you present a child via .sheet the environment object is not automatically inherited, so it means I should call .environmentObject() directly on CreatePortfolioBottomSheetView, but I again don't have ManagePortfolioViewModel inside destination...
I appreciate any advice!
Beta Was this translation helpful? Give feedback.
All reactions