I have created a custom nib and added it to my view hierarchy. The view separates to subviews using a constraint which is greater than or equal to, in other words, giving the view a minimum size to work with.
Is it possible to get the minimum size of a UIView from the constraints system?
UIView has a method systemLayoutSizeFittingSize: to return the smallest size (or largest size) for a view.
CGSize smallestViewSize = [view systemLayoutSizeFittingSize: UILayoutFittingCompressedSize];
The UIView method intrinsicContentSize returns the most desired size. This size may be somewhat in the middle of the two sizes returned before.
Prior to iOS6, you would call sizeThatFits: to get a fitting size that may be smaller than the size passed in or was by default the bounds of the receiver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With