How would I use Typhoon with iOS storyboards where view controllers are generated implicitly by the system? Would I have to do something special in the prepareForSegue methods?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
There is a TyphoonStoryBoard component in the backlog,
however it hasn't been implemented yet(see update below).There is currently a -injectProperties: method on the component factory that you can use to apply dependency injection on a component after it has been instantiated, ex. by the story board.
For now, you could subclass UIStoryboard and call the -injectProperties: on the view controller by overriding:
Example:
Update:
TyphoonStoryBoard integration has now been completed (pending documentation), and committed to master. It will be released as part of Typhoon 2.0, in the coming weeks.
It is very simple with TyphoonStoryboard
By bootstrapping Typhoon in your plist, along with the usual UILaunchStoryboardName and UIMainStoryboardFile, Typhoon will ensure that all Storyboards are an instance of TyphoonStoryboard. Use exactly as you would a normal Storyboard, with the added benefit that dependencies will be injected according to the definitions in your TyphoonAssembly class(es).
Optionally, you can specify which definition should be used for each viewController. For that, use 'typhoonKey' runtime attribute in storyboard. Otherwise the definition matching the controller class will be used. Example:
The documentation for this feature is here.