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.
Asked
Active
Viewed 698 times
0

Shobhakar Tiwari
- 7,862
- 4
- 36
- 71

IKKA
- 6,297
- 7
- 50
- 88
-
you can just drag and drop a CollectionViewCell into the CollectionView. Have you tried this? – dirtydanee Oct 26 '16 at 08:35
-
yes tried it.But i cant get it. – IKKA Oct 26 '16 at 08:36
-
are you seeing the cell in the collection view? – Ahmad F Oct 26 '16 at 08:37
-
can you change the number of items? http://imgur.com/a/nsq79 – dirtydanee Oct 26 '16 at 08:41
-
@dirtydanee I cant see that option(items) – IKKA Oct 26 '16 at 08:42
-
what can you see? – dirtydanee Oct 26 '16 at 08:42
-
delete it and again try to drag collectionview – Shobhakar Tiwari Oct 26 '16 at 08:45
-
7You can not add prototype cell in XIB file, you need to use StoryBoard to add prototype cell inside collection view. – Mohammad Zaid Pathan Oct 26 '16 at 08:46
2 Answers
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