Swinject/SwinjectStoryboard

SwinjectStoryboard resolve nil object

seyhagithub opened this issue · 2 comments

SwinjectStoryboard cannot hold reference to object or it resolves nil object when block of storyboardInitCompleted finished. That's why all objects in my ViewController are nil, it makes my app crash in Swift 4. But in Swift 3.3 is working fine. please help me to solve this problem.

Hi @seyhagithub! I have the same problem, have you sort it?

Have you registered your classes on the SwinjectStoryboard.defaultContainer? The SwinjectStoryboard will use that container by default. I personally use this container to instantiate my Assembler like so:

let assembler = Assembler(container: SwinjectStoryboard.defaultContainer)

assembler.apply(assembly: MyAssembly())
...