I have created a UIcollectionView and an array with some strings @[@"Item One", "Item Two", @"Item Three"];
In Tableview I would do this:
NSString *object = self.titlesArray[indexPath.row];
cell.textLabel.text = object;
But I can really not figure out how to do this for Items in UIcollectionView.
UICollectionViewCell
doesn’t have a default cell style.
You have to create a custom UICollectionViewCell
and add a UILabel
inside.
UICollectionViewCell
does not have default textLabel
as UITableviewCell
has, you have to create custom UICollectionViewCell
as per your need.
You can look at this tutorial how to create custom collection view cell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With