I would like the UICollectionView (The red one) to shrink to the height of the content size in this case UICollectionViewCells(the yellow ones) because there is a lot of emp
work for me
let heightRes = resCollectionView.collectionViewLayout.collectionViewContentSize.height foodHeightConstrant.constant = height.advanced(by: 1 ) foodCollectionView.setNeedsLayout() foodCollectionView.layoutIfNeeded()