You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found an issue with SwinjectStoryboard, I am trying to create two instances of the same view controller: I.E. Here are my dependencies:
container.register(MyViewModeling.self) { r in
MyViewModel(someDependency)
}
container.storyboardInitCompleted(MyVC.self) { r, c in
c.viewModel = r.resolve(MyViewModeling.self)!
}
Here is an example of how I resolve my instances:
let myVcs = [0,1].map { _ in storyboard.instantiateViewController(withIdentifier: MyVC.Self) }
The issue is that the second instance of MyVC created, doesn't contain a viewModel. Meaning I don't go through the dependency injection process(invoke).
I started investigating, and as it turns out from what I see in SwinjectStoryboard source code, when I get to the actual resolve method, I hit the entry.storage.instance(inGraph: currentObjectGraph), which does find an entry for my VC, and instead of invoking dependency injection, it just returns the VC that I have already instantiated.
The text was updated successfully, but these errors were encountered:
I have found an issue with SwinjectStoryboard, I am trying to create two instances of the same view controller: I.E. Here are my dependencies:
Here is an example of how I resolve my instances:
The issue is that the second instance of MyVC created, doesn't contain a viewModel. Meaning I don't go through the dependency injection process(invoke).
I started investigating, and as it turns out from what I see in SwinjectStoryboard source code, when I get to the actual resolve method, I hit the entry.storage.instance(inGraph: currentObjectGraph), which does find an entry for my VC, and instead of invoking dependency injection, it just returns the VC that I have already instantiated.
The text was updated successfully, but these errors were encountered: