Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Late Init Issue on RouterObject #12

Closed
savage7 opened this issue Aug 23, 2021 · 0 comments · Fixed by #13
Closed

Late Init Issue on RouterObject #12

savage7 opened this issue Aug 23, 2021 · 0 comments · Fixed by #13

Comments

@savage7
Copy link
Contributor

savage7 commented Aug 23, 2021

In the testbed code the ViewModel of the LoginScreen is created within the View itself:
@StateObject var viewModel = LoginScreenViewModel()

When the ViewModel is created i.e. in the Coordinator like this (before the Coordinator is created):
LoginScreen(viewModel: loginViewModel)

Then the RouterObject fails to retrieve the Router because it's only done once in the constructor of the RouterObject:
self.retreived = storage.retrieve()
The RouterObject fails to retrieve the Coordinator and navigation doesn't work.

savage7 added a commit to savage7/stinsen that referenced this issue Aug 23, 2021
Fix rundfunk47#12 dynamically retrieve coordinator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant