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

How get controllers from a different coordinator ? #2

Open
tsomaev opened this issue Jul 21, 2021 · 1 comment
Open

How get controllers from a different coordinator ? #2

tsomaev opened this issue Jul 21, 2021 · 1 comment

Comments

@tsomaev
Copy link

tsomaev commented Jul 21, 2021

Suppose, I want a presented or pushed the PurchaseController on the FirstCoordinator, and also on the SecondCoordinator
I will need a initialize the PurchaseController on the First and Second coordinator ?

@wojciech-kulik I did read your article about MVVM and Coordinator and implemented him on my project, and i like him, thanks 🙂

@wojciech-kulik
Copy link
Owner

Yes, it's not a problem, you can instantiate PurchaseController from both coordinators or you can extract this code to another class and pass it as a dependency to your coordinator. However, I think the best approach is to create PurchaseCoordinator and start it as a child coordinator from FirstCoordinator and SecondCoordinator. Most likely you will implement there also some delegate, so you won't duplicate code this way ;)

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

No branches or pull requests

2 participants