I am using the UICollectionViewDelegateFlowLayout in my subclassed UICollectionViewController, I am setting the heights of the cells with this:
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let cellHeight = arc4random_uniform(100) + 200
print("cell height: \(cellHeight)")
return CGSize(width: collectionView.bounds.size.width/2 - 1, height: CGFloat(cellHeight))
}
And the cells now look like this:
Is there a way I can make the CollectionViewCells have 0 vertical space in between cells? Obviously this would mean the rows are not aligned, so does that make it impossible to do with a Flow
layout?