I'm using a collection view inside a normal view controller using the collection view delegate and data source. I'm using the sizeForItemAtIndexPath but it doesn't resize the cell.
let screenSize: CGRect = UIScreen.main.bounds
func collectionView(_collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
return CGSize(width: screenSize.width / 3, height: screenSize.width / 3)
}
The collection view is assigned the constraints using autoLayout properly.
I know the estimatedItemSize is used but I'm unable to use it since this is not a UICollectionViewController. Thanks for any suggestion?
Make sure that:
UICollectionViewDelegateFlowLayout
.minimumInteritemSpacingForSectionAt
returning zero.I hope that answered your question.