Created
November 7, 2015 08:07
-
-
Save Teino1978-Corp/2fd5fa704816025415f9 to your computer and use it in GitHub Desktop.
Get CGSize from NSString
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)getNSStringSize:(NSString *)string withFont:(UIFont *)font{ | |
| NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font,NSFontAttributeName, nil]; | |
| return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment