Last active
August 29, 2015 14:20
-
-
Save lonelytango/9ba75398336dd91685ab to your computer and use it in GitHub Desktop.
Method to replace sizeWithFont:constrainedToSize:lineBreakMode:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGSize maximumLabelSize = CGSizeMake(tableView.width, MAXFLOAT); | |
NSStringDrawingOptions options = NSStringDrawingTruncatesLastVisibleLine | | |
NSStringDrawingUsesLineFragmentOrigin; | |
NSDictionary *attr = @{NSFontAttributeName: [UIFont systemFontOfSize:15]}; | |
CGRect labelBounds = [string boundingRectWithSize:maximumLabelSize | |
options:options | |
attributes:attr | |
context:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment