Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwinjectStoryboard resolve nil object #106

Open
seyhagithub opened this issue Aug 30, 2018 · 2 comments
Open

SwinjectStoryboard resolve nil object #106

seyhagithub opened this issue Aug 30, 2018 · 2 comments

Comments

@seyhagithub
Copy link

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.

@FranciscoPereira
Copy link

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

@mpdifran
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants