title: Is it possible to instantiate a View Controller from a Storyboard for Kiwi Testing
body: <p>I'm in for testing some code within a ViewController (that certain controls are active depending on the state of certain UISwitches etc) and decided to go for Kiwi for it, since we are using it for some other low-level logic testing. </p>
  
  <p>My expectation is to run tests like this: </p>
  
  <pre><code>__block AViewController *aVC;
  
  it(@"(tokenTextField) should be hidden if the token switch is set to off", ^{
      lvC.useTokenSwitch.on = false;
      [[theValue(aVC.tokenTextField.hidden) should] equal:theValue(YES)];
  });
  </code></pre>
  
  <p>My problem is with the initialisation of the AViewController. If I did: </p>
  
  <pre><code>aVC = [[AViewController alloc] initWithNibName:@"aViewController" bundle:nil];
  </code></pre>
  
  <p>I would be getting a "AViewController" without any controls initialised, so I'd have to init each of them manually. </p>
  
  <p>So I have tried obtaining the AViewController doing this: </p>
  
  <pre><code>UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
  aVC = [storyboard instantiateViewControllerWithIdentifier:@"AViewController"];
  </code></pre>
  
  <p>Yet this results in an error message: </p>
  
  <blockquote>
    <p>NSInvalidArgumentException "Could not find a storyboard named 'MainStoryboard' in bundle NSBundle &lt;/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/Developer/usr/bin&gt; (loaded)" raised</p>
  </blockquote>
  
  <p>I have included the MainStoryboard in my testing target, and also included it in "Build Phases" -> "Copy Bundle Resources" and still nothing. </p>
  
  <p>So I am wondering if it is even possible to instantiate a ViewController from a Storyboard in a Kiwi Testing Target? (As I haven't seen any examples of it anywhere). </p>
  
  <p>Is my approach wrong and I should be mocking the ViewController?</p>
  
  <p>Am I missing something to be included in the test target?</p>