title: UICollectionView, nib from a framework target registered as a cell fails at runtime
body: <p>I have a UICollectionViewCell drawn out in a xib and accompanied by swift class file. These two files are part of my app's UI framework target (called SomeUI).</p>
  
  <p>In the view controller of my collection view (in the app target) I register the nib as a collection view cell. My view controller code is as follows;</p>
  
  <pre><code>import UIKit
  import SomeUI
  
  let reuseIdentifier = "Cell"
  
  class ACollectionViewController: UICollectionViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          self.collectionView.registerNib(UINib(nibName: "JamesTheCollectionViewCell", bundle: NSBundle(identifier: "SomeUI")), forCellWithReuseIdentifier: reuseIdentifier)
      }
  
      override func numberOfSectionsInCollectionView(collectionView: UICollectionView!) -&gt; Int {
          return 1
      }
  
      override func collectionView(collectionView: UICollectionView!, numberOfItemsInSection section: Int) -&gt; Int {
          return 1
      }
  
      override func collectionView(collectionView: UICollectionView!, cellForItemAtIndexPath indexPath: NSIndexPath!) -&gt; UICollectionViewCell! {
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as JamesTheCollectionViewCell
          cell.titleLabel.text = "yippee"
          return cell
      }
  }
  </code></pre>
  
  <p>In the nib, the cell view has its custom class set appropriately; JamesTheCollectionViewCell in module SomeUI.</p>
  
  <p><img src="https://i.stack.imgur.com/vkI4h.jpg" alt="screengrab of cell xib in xcode"></p>
  
  <p>While Xcode seems quite happy with this setup, at runtime i get an error as the class defined in JamesTheCollectionView.swift cannot be found.</p>
  
  <blockquote>
    <p>Unknown class _TtC19collectionViewThing26JamesTheCollectionViewCell in
    Interface Builder file.</p>
  </blockquote>
  
  <p>If I switch the target membership for JamesTheCollectionView.swift from the framework to the application (but leave the xib as part of the framework), everything runs fine. But, I asked the xib file to load the class from the framework… what am i missing, why doesn't it work when the cell implementation class is part of the framework?</p>
  
  <p>For reference, here is the cell implementation file:</p>
  
  <pre><code>import UIKit
  
  public class JamesTheCollectionViewCell: UICollectionViewCell {
      @IBOutlet public weak var titleLabel: UILabel!
  }
  </code></pre>