Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class DynamicHeightCollectionView: UICollectionView {
override func layoutSubviews() {
super.layoutSubviews()
if!__CGSizeEqualToSize(bounds.size,self.intrinsicContentSize){
self.invalidateIntrinsicContentSize()
}
}
override var intrinsicContentSize: CGSize {
return contentSize
}
}
@pingwinator

This comment has been minimized.

Copy link

pingwinator commented Mar 11, 2019

imho, better to use a swift extension for comparison 2 sizes: if !bounds.size.equalTo(intrinsicContentSize) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.