Skip to content

Instantly share code, notes, and snippets.

@jeffbailey
Created July 28, 2014 20:11
Show Gist options
  • Save jeffbailey/5683fc5441c91377bb73 to your computer and use it in GitHub Desktop.
Save jeffbailey/5683fc5441c91377bb73 to your computer and use it in GitHub Desktop.
Multiline UILabel in Interface Builder
// The first two lines can be set in Interface builder
self.titleLabel.numberOfLines = 0;
self.titleLabel.lineBreakMode:NSLineBreakByWordWrapping;
[self.titleLabel setPreferredMaxLayoutWidth:self.frame.size.width-50];
// Also in IB, set a constraint on the label so the height it >= the height of a single line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment