Reputation: 898
I'm struggling with manipulating my UICollectionViewCell sizes, since it seem the function is deprecated, same goes for spacing. I've tried with this one:
func collectionView(collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSize(width: 150, height: 150)
}
Which function am I supposed to use in Swift 3?
Upvotes: 0
Views: 5602
Reputation: 1344
You can use below delegate method.
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: 100, height: 100)
}
Upvotes: 0
Reputation: 688
you can try this code in swift3
override var collectionViewContentSize: CGSize {
return CGSize(width: 150, height: 150)
}
Upvotes: 4