When working with storyboards in Typhoon, if I do something like this in the assembly
- (id)myController
{
return [TyphoonDefinition withClass:[BigController class] configuration:^(TyphoonDefinition *definition) {
[definition injectProperty:@selector(dao) with:[_dataAssembly dao]];
}];
}
Later I want the factory to hand me the controller from the Typhoon story board however I end up with the plain controller created using alloc/init
vc= [_factory componentForType:[BigController class]];
In AppDelegate I am using the typhoon storyboard as follows
TyphoonComponentFactory *factory = [[TyphoonBlockComponentFactory alloc] initWithAssemblies:@[[Q_Assembly assembly],[P_Assembly assembly]]];
I can go back to using the StoryboardWithIdentifier...but I would like to use the _factory
to be able to get the reference to the controller I want from storyboard.
Have you tried declaring the storyboard as a factory component? Here's an example:
You should now be able to resolve this component from the factory. The documentation for this feature is here.
Incidentally, I note that you're resolving you controller using the TyphoonComponentFactory interface, which is fine. But did you know that the TyphoonComponentFactory can pose as any of your assembly interfaces? So you can also resolve as follows:
. . . this is especially useful for the following:
Example: