Skip to content

Instantly share code, notes, and snippets.

@EskiMag EskiMag/gist:845240
Created Feb 26, 2011

Embed
What would you like to do?
CGFloat width = 300;
// returns 15
[text sizeWithFont:[UIFont fontWithName:@"Helvetica" size:12.0] forWidth:width lineBreakMode:UILineBreakModeWordWrap].height;
// returns 60
[text sizeWithFont:[UIFont fontWithName:@"Helvetica" size:12.0] constrainedToSize:CGSizeMake(width, 100) lineBreakMode:UILineBreakModeWordWrap].height
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.