SwinjectStoryboard icon indicating copy to clipboard operation
SwinjectStoryboard copied to clipboard

SwinjectStoryboard resolve nil object

Open seyhagithub opened this issue 7 years ago • 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.

seyhagithub avatar Aug 30 '18 09:08 seyhagithub

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

FranciscoPereira avatar Oct 10 '18 13:10 FranciscoPereira

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())
...

mpdifran avatar Feb 11 '19 02:02 mpdifran