This is driving me crazy! I have a UICollectionViewController as shown below:
class PhrasesCompactCollectionViewController: UICollectionViewController
Three things you need to check if no answer works:
Implement FlowLayout Delegate : class MyController: UICollectionViewController, UICollectionViewDelegateFlowLayout
Use method for size of item for swift 3.0+: func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: (collectionView.frame.width / 3) - 1, height: collectionView.frame.width)
}
Select Estimate size = None
in Inspect element of UICollectionView.