Navigation in StateObject #94
Unanswered
nts-sixblack
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @nts-sixblack , thanks for the question! Sadly, SwiftUI's environment is only available in views. I guess you could work around that by passing the navigator from the view to the view model. Or by passing something like a navigator through some other dependency system that's available outside views, e.g using swift-dependencies. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
As I see, to manage navigation in child views, people usually use @EnvironmentObject var navigator: FlowPathNavigator or corresponding components, is there any way I can use it in @StateObject var viewModel of the view to manage navigation?
Beta Was this translation helpful? Give feedback.
All reactions