0

I am using Xcode7.3.1 . I added CollectionView from object library to xib file then i can’t find CollectionViewCell under CollectionView.Here attached the screenshot.This screenshot displays CollectionView only contain CollectionViewFlowLayout.Please help me how to resolve this issue.

enter image description here

Shobhakar Tiwari
  • 7,862
  • 4
  • 36
  • 71
IKKA
  • 6,297
  • 7
  • 50
  • 88

2 Answers2

2

Prototypes Cells (UITableviewCell and UICollectionViewCell) are only available in storyboard.

If you want to use the xib for custom cell, create separate xib for each prototype cell. Assign custom class and Identifier to that cell.

Now, you need to register that custom xib to use it in Collection View.

[self.collectionView registerNib:[UINib nibWithNibName:@"MediaCollectionViewCell" bundle:nil] forCellWithReuseIdentifier:@"MediaCollectionViewCell"];
MD.
  • 1,157
  • 11
  • 18
0

You can easily drag and drop from file inspector enter image description here

Or you can create custom xib cell

Minkle Garg
  • 723
  • 3
  • 9
  • 35