How to resize UILabels to fit content?

Solutions Collect From Internet About “How to resize UILabels to fit content?”

After setting the text of the label, call sizeToFit on the label. This will make the label just big enough for the text.

BTW – why do you need to do this? Why not just make the labels big enough for the possible values and leave them that size? What benefit do you think you will get by shrinking the labels?