title: How can we load .xib files in collection view cell in iOS?
body: <p>I have created collection view programmatically and I am adding .xib file in collection view cell like below</p>
  
  <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString * const reuseIdentifier = @"CollectionCell";
  
      CollectionCell *cell = (CollectionCell *)[collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
  
      if (cell == nil)
      {
          NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CollectionCell" owner:self options:nil];
          cell = [nib objectAtIndex:0];
      }
  
      cell.itemImage.image = [UIImage imageNamed:images[indexPath.row]];
      cell.itemLabel.text = [NSString stringWithFormat:@"Item Index %ld",(long)indexPath.row];
      return cell;
  }
  </code></pre>
  
  <p>But it's showing exception like</p>
  
  <pre><code>could not dequeue a view of kind: UICollectionElementKindCell with identifier CollectionCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
  </code></pre>
  
  <p>What did I do here wrong??? Help me please.</p>