sizewithfont

Check if there is an emoji contained in a string

I am getting the text size of a string with this textSize = [[tempDict valueForKeyPath:@"caption.text"] sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(280, CGFLOAT_MAX) lineBreakMode: NSLineBreakByWordWrapping]; The only problem I have is that if the string only contains an...

How to use NSString's sizeWithFont and drawInRect to workout how much of a string to draw

I'm drawing multiple 'pages' of imagery using a CGContext in the iOS. I've used sizeWithFont and drawInRect combinations extensively in my app. What I need to do is split a large chunk of text across multiple pages. I can size it and work out whether or not it needs another page but how do I know...

Replacement for deprecated -sizeWithFont:constrainedToSize:lineBreakMode: in iOS 7?

In iOS 7, the method: - (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode and the method: - (CGSize)sizeWithFont:(UIFont *)font are deprecated. How can I replace CGSize size = [string sizeWithFont:font constrainedToSize:constrainSize...