intrinsic-content-size
How to set a custom view’s intrinsic content size in Swift?
Setting the intrinsic content size of a custom view lets auto layout know how big that view would like to be. In order to set it, you need to override intrinsicContentSize. override var intrinsicContentSize: CGSize { return CGSize(width: x, height: y) } Then call invalidateIntrinsicContentSize() Whenever your custom view’s intrinsic content size changes and the … Read more