In UILabel there's functionality to truncate labels using different truncation techniques (UILineBreakMode). In NSString UIKit Additions there is a similar functionality for drawing strings.
However, I found no way to access the actual truncated string. Is there any other way to get a truncated string based on the (graphical) width for a given font?
I'd like to have a category on NSString with this method:
-(NSString*)stringByTruncatingStringWithFont:(UIFont *)font forWidth:(CGFloat)width lineBreakMode:(UILineBreakMode)lineBreakMode