Closed RomanTruba closed 7 years ago
you can declare collaborating assemblies inside any assembly as properties. For example you can declare property of Child assembly inside Parent assembly and wise versa. Using that you can inject parent presenter as module output for child.
@alexgarbarev thanks for response. Actually, I tried it before. As the result, it will lead to new objects creation, instead of wiring existing objects. For example, Child will have another parent presenter object, not the one Parent owns.
After some time, I found out my problem is different from DI, and depends more from runtime segues. So I used ViperMcFlurry with some changes.
I'm trying to implement different VIPER modules on one screen. In storyboards a view controller can contain a container view with another view controller connected by "Embed segue". The question is how to implement assembly which will inject main view controller's "presenter" (which is a property of a view controller) to embedded view controller's "presenter" when we instantiate it from storyboard? I know, I can extract it from parent by overriding "didMoveToParentViewController:" but it will lead to unwanted coupling.