From @gilgol on April 9, 2018 11:40
I'm trying to dynamically resolve a protocol ViewModeling that 2 different view models are conforming to..
I am able to do it on the service level (one protocol that 2 services are conforming to, and 2 different viewModel that each consume a different service can resolve the required one using a specific name)
I'm struggling with doing this on the viewController level, trying to inject the same view controller a specific viewModel (both conforms as mentioned to the same protocol).
I believe the issue is with SwinjectStoryboard that doesn't let me instantiate a view controller using its storyboard id (like I would normally do), and in addition define few different names that will be resolved on runtime.
Am I missing something?
Just realised it might be more appropriate as a stackoverflaw post, so here is a link to the post:
https://stackoverflow.com/questions/49732300/how-to-inject-the-right-viewmodel-to-a-single-viewcontroller
Copied from original issue: Swinject/Swinject#345
From @gilgol on April 9, 2018 11:40
I'm trying to dynamically resolve a protocol
ViewModelingthat 2 different view models are conforming to..I am able to do it on the service level (one protocol that 2 services are conforming to, and 2 different viewModel that each consume a different service can resolve the required one using a specific
name)I'm struggling with doing this on the viewController level, trying to inject the same view controller a specific viewModel (both conforms as mentioned to the same protocol).
I believe the issue is with
SwinjectStoryboardthat doesn't let me instantiate a view controller using its storyboard id (like I would normally do), and in addition define few different names that will be resolved on runtime.Am I missing something?
Just realised it might be more appropriate as a stackoverflaw post, so here is a link to the post:
https://stackoverflow.com/questions/49732300/how-to-inject-the-right-viewmodel-to-a-single-viewcontroller
Copied from original issue: Swinject/Swinject#345