title: Swift, could not cast value of type
body: <p>I created a subclass of <code>UICollectionViewController</code> and called it <code>LibraryCollectionViewController</code>, and marked both checkboxes for the project and test. Also it's storyboard id is <code>LibraryCollectionViewController</code> and set its corresponding class on interface builder.</p>
  
  <p>Being new to <strong>Swift</strong> and <strong>iOS Testing</strong> I went and attempted to instantiate said view controller inside my test case as follows:</p>
  
  <pre><code>let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let libraryCollectionVC = storyboard.instantiateViewControllerWithIdentifier("LibraryCollectionViewController") as! LibraryCollectionViewController
  </code></pre>
  
  <p>And I'm getting the following error:</p>
  
  <pre><code>Could not cast value of type 'MyApp.LibraryCollectionViewController' (0x1010b01f0) to 'MyAppTests.LibraryCollectionViewController' (0x10bd7f580).
  </code></pre>
  
  <p>So it is clear that it isn't casting, but as I'm still new to Swift, I find myself unable to determine if the error itself is being caused by:</p>
  
  <ol>
  <li>I did something wrong when creating the subclass and I'm referencing a different one (Ergo the MyApp.[vc] vs MyAppTests.[vc])</li>
  <li>The casting using <code>as!</code> is incorrect</li>
  <li>Any other reason</li>
  </ol>
  
  <p>Any help would be appreciate, thanks in advance.</p>
  
  <p><strong>Update 1:</strong> When I was creating the view controller, the last step shows 2 checkboxes under a <strong>Target</strong> header, I enabled both of them, could that be the cause?</p>