title: Swift - could not dequeue a view of kind: UICollectionElementKindCell with identifier
body: <p>I got this error message when trying to load UICollectionView.</p>
  <blockquote>
  <p>2015-07-23 16:16:09.754 XXXXX[24780:465607] Terminating app due to
  uncaught exception 'NSInternalInconsistencyException', reason: 'could
  not dequeue a view of kind: UICollectionElementKindCell with
  identifier CollectionViewCell - must register a nib or a class for the
  identifier or connect a prototype cell in a storyboard'</p>
  <p>First throw call stack:</p>
  </blockquote>
  <p>My code</p>
  <pre><code>@IBOutlet var collectionView: UICollectionView!
  
  func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
          
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier(&quot;CollectionViewCell&quot;, forIndexPath: indexPath) as! CollectionViewCell
          
          cell.backgroundColor = UIColor.blackColor()
          cell.textLabel?.text = &quot;\(indexPath.section):\(indexPath.row)&quot;
          cell.imageView?.image = UIImage(named: &quot;category&quot;)
  
          return cell
  
      }
  </code></pre>
  <p>I already declared <code>CollectionViewCell</code> in storyboard inspector but the error message still occur.</p>
  <p><a href="https://i.stack.imgur.com/bVy9p.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bVy9p.png" alt="enter image description here" /></a></p>