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
Data Flow through TCACoordinators? #30
Comments
Hi @rhysm94! Thanks for raising this issue, and for the example code. I've imported your code into the example project and adapted it in this commit. Essentially, I've added state to the coordinator for each of the steps as you said. With the state held in the coordinator, the stored routes no longer need to store data, just a screen identifier - |
Thank you very much! That worked perfectly. I did hit a snag at one point, on the actual project this is for, which involves a few more screens. For some reason, it was compiling just fine, but I was hitting an Anyway, thanks again - this has been an enormous help! |
Great, glad it helped! I might adapt this demo to include in the example app if that's ok? |
Yes, absolutely! More than happy 😃 |
I'm having some issues coming up with a way to send data from my nested views back to my Coordinator state, when building a multi-step form.
I've created a repository with a sample SwiftPM application, with a three step form, and a submission page. Currently, they don't have any means of communication with each other.
In this example codebase, I'd like to be able to persist the values in Step 1, Step 2, and Step 3, so that the user can go back and forth between each page without losing any data, but I can't find any hook for when the current page state is updated. The
updateRoutes
action doesn't get called when I'd expect it to, only seemingly when the view is dismissed, not presented on top of.Is there something I'm missing with this? It feels like I should be able to keep Step 1, 2, and 3 state in my Coordinator state (or even a parent state), so that next time the user navigates from Step 1 -> Step 2, I can call:
and have that view pre-populated with whatever was entered from when they were last on the Step 2 page.
Any help here would be massively appreciated! Thanks!
The text was updated successfully, but these errors were encountered: