+1
Would love an official answer to this question
Post
Replies
Boosts
Views
Activity
Implementing preferredLayoutAttributesFitting(_:) in my collection view cell fixed this problem:
override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
let targetSize = CGSize(width: layoutAttributes.frame.width, height: 0)
let modifiedAttributes = super.preferredLayoutAttributesFitting(layoutAttributes)
modifiedAttributes.frame.size = contentView.systemLayoutSizeFitting(targetSize, withHorizontalFittingPriority: .required, verticalFittingPriority: .fittingSizeLevel)
return modifiedAttributes
}