Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sizeForItemAtIndexPath is not found in different swift versions

I am using UICollectionView but following method not found:

 func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize

please suggest me it's replacement.

like image 844
Vikram Biwal Avatar asked Oct 14 '16 06:10

Vikram Biwal


1 Answers

For me sizeForItemAt wasn't called because in Swift 3 you need to explicitly set your class to implement the UICollectionViewDelegateFlowLayout protocol

like image 196
Roland Keesom Avatar answered Oct 07 '22 18:10

Roland Keesom