Created
February 12, 2014 18:02
-
-
Save nenadvulic/8961086 to your computer and use it in GitHub Desktop.
estimated height for cell with constraints
This file contains 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
+ (CGFloat) estimateHeight:(NSString *)content{ | |
NSAttributedString *bodyText = [NSAttributedString attributedStringWithMarkdownString:content font:MYCellFontDefine]; | |
CGRect rect = [bodyText boundingRectWithSize:CGSizeMake(CELL_WIDTH, FLT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil]; | |
return CGRectGetHeight(rect); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment