Instance Property

intrinsicContentSize

The natural size for the receiving view, considering only properties of the view itself.

Declaration

var intrinsicContentSize: CGSize { get }

Discussion

Custom views typically have content that they display of which the layout system is unaware. Setting this property allows a custom view to communicate to the layout system what size it would like to be based on its content. This intrinsic size must be independent of the content frame, because there’s no way to dynamically communicate a changed width to the layout system based on a changed height, for example.

If a custom view has no intrinsic size for a given dimension, it can use UIViewNoIntrinsicMetric for that dimension.