I'm new to Typhoon. I'm reading documentation to inject dependencies into my storyboard's view controllers. I have basic understand of how the framework does the DI on classes, but storyboards seems complicated. I have read both storyboards and PList integration documentation but I'm kind of confused.
This may sound silly and obvious. If my storyboard filename is Main.storyboard
, in my plist
I'd add key UILaunchStoryboardName
with value Main.storyboard
?
What would be the value for key UIMainStoryboardFile
?
Do dependencies get injected automatically or how do I specify which dependencies get injected into each of my storyboard's view controllers?
I was unable to find an example or tutorial that uses storyboard (and since most of them are in objc and I'm working with Swift, it's kinda hard to follow up every step, so I apologize in advance if these questions are silly
To answer questions one and two, if you create a project from Xcode specifying to use storyboards, then those values will already be completed in your plist. If you have a legacy project, this is a nice way to see what those values should be.
As for question 3, if you 'annotate' your storyboard view controllers with auto-injection macros, then dependencies are indeed injected automatically. For non-storyboard view controllers then to have dependencies injected, an instance should be obtained from Typhoon, just like in the Quick Start.
Note that you can inject the assembly itself into a view controller, in order to load an injected object graph 'on demand'.