UICollection View causes "UICollectionViewFlowLayoutBreakForInvalidSizes" on smaller devices
By confirming UICollectionViewDelegate
from your class. The delegate method sizeForItemAtIndexPath
will call from UICollectionViewDelegateFlowLayout
and this will call in your class now you can return the size of UICollectionViewCell
.
This works for me
method:
collectionView.delegate = self
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSizeMake(collectionView.frame.size.width, collectionView.frame.size.height)
}