I\'m updating my app to iOS 7 and finally got it, but there\'s one thing I can\'t find a solution for.
In Xcode 4 I used the following method:
#defin
sizeWithFont methods were deprecated in iOS7. You should use boundingRectWithSize instead. If you also need to support prior iOS versions then you can use following code:
CGSize size = CGSizeZero;
if ([label.text respondsToSelector: @selector(boundingRectWithSize:options:attributes:context:)] == YES) {
size = [label.text boundingRectWithSize: constrainedSize options: NSStringDrawingUsesLineFragmentOrigin
attributes: @{ NSFontAttributeName: label.font } context: nil].size;
} else {
size = [label.text sizeWithFont: label.font constrainedToSize: constrainedSize lineBreakMode: UILineBreakModeWordWrap];
}