[UILabel sizeToFit]

If you’re positioning views with frames (not using Auto Layout), UILabel’s sizeToFit method is great for making a text label’s height and width fit the text that’s inside it.

CGRect frame = CGRectMake(0, 0, 320, 480);
UILabel *myLabel = [[UILabel alloc] initWithFrame:frame];
myLabel.text = @"Any size text string";
[myLabel sizeToFit];

Thanks to the Stack Overflow community for teaching me about this.