Auto sizing UILabel when using Autolayout
ios, uikit
Solution
Make an IBOutlet for your width and height constraints, and use `sizeToFit` to change their `constant` property, and call `needsUpdateConstraints`
Problem
I'm creating a xib using autolayout (NSLayoutConsraint). Is there a way to use sizeToFit or something similar to make a UILabel fit its contents? I've tried setting a constraint of "greater than or equal to x" and tried setting the height to be below this. However, it keeps overwriting the height property. sitToFit doesn't seem to work when you have NSLayoutConstraints. How can I get the label to size appropriately?