Reputation: 725
I followed the tutorial:http://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell/ to implement a UICollectionView inside of a UITableViewCell. How to I implement a custom UICollectionViewCell inside of the UICollectionView programmatically without using the storyboard? I just need a simple UILabel inside my UICollectionViewCell. Any help would be greatly appreciated.
Upvotes: 0
Views: 1072
Reputation: 1048
Create a custom UICollectionViewCell
, named it CustomCell
, and implement the method initWithFrame
, where you can add UILabel
to your cell.
Register your custom UICollectionViewCell
[self.collectionView registerClass:[CustomCell class] forCellWithReuseIdentifier:CollectionViewCellIdentifier];
Dequeue Cell in cellForItemAtIndexPath
CustomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CollectionViewCellIdentifier forIndexPath:indexPath];
Upvotes: 2