Skip to content

Storyboards

jasperblues edited this page Dec 23, 2014 · 11 revisions

By using plist integration, 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).

The TyphoonComponentFactory will be retained by the storyboard, and so persists throughout the life-cycle of your application.

By default Typhoon will inject by matching the type of the UIViewController to a component in the assembly. Optionally, you can specify which definition should be used for each viewController using the 'typhoonKey' runtime attribute. Example:

TyphoonStoryBoard

###Creating a new Storyboard Programmatically

UIStoryboard *board = [TyphoonStoryboard storyboardWithName:@"AStoryBoardName" 
    factory:factory bundle:[NSBundle mainBundle]];

where 'factory' is obtained using the the approach described in proceeding from one object graph to another



See also: Storyboards work well in conjunction with Autowiring