title: Typhoon: injecting a view controller provider
body: <p>When using a hand made container/injector responsible for creating and managing the lifecycle of the objects in my graph I use the following pattern(I read in an article about DIY DI in ObjC):</p>
  
  <p>Let's say we have a root view controller that wants to present another one(let's call it detail view controller) passing some data to it. What I normally do is to inject a provider block that takes the data as an argument and returns a new view controller to present. Here is some code...</p>
  
  <pre><code>@implementation RootViewController
  {
      UIViewController (^detailViewControllerProvider)(SomeData *someData);
  }
  
  - (id) initWithDetailViewControllerProvider:(UIViewController (^)(SomeData *someData))detailViewControllerProvider
  {
     //...
     _detailViewControllerProvider = detailViewControllerProvider;
     //...
  }
  
  // ...
  
  - (void) presentDetailViewControllerWithData:(SomeData *)someData
  {
      UIViewController *detailViewController = _detailViewControllerProvider(someData);
      [self presentViewController:detailViewController animated:YES completion:nil];
  }
  
  @end
  </code></pre>
  
  <p>I could use a factory class as well but this way I avoid creating a new class just creating the provider block in my container class.</p>
  
  <p>The problem comes when I want to use Typhoon as a DI container. How can I use the same pattern? In my detail view controller I am injecting other things and I want to keep using constructor injection, and prefer if it is created by the component factory, not by me. I could create a factory class to create the detail VC, injecting in it(the factory) the dependencies I want to inject later in my detail VC, but it seems too much work comparing to the block based solution. </p>
  
  <p>I don't want to access my component factory from the root view controller and neither use setter injection for someData. </p>
  
  <p>Is there any solution for this?</p>