NSString sizeWithFont: constrainedToSize: is deprecated in iOS7
matsekberg opened this issue · comments
I solved it by replacing this:
return [messageText sizeWithFont:[self fontOfMessage] constrainedToSize:CGSizeMake(self.tableView.bounds.size.width - 30, FLT_MAX)].height + kSPUILoggerMessageMargin;
with this:
NSString *messageText = [self textOfMessageForIndexPath:indexPath];
NSAttributedString *attributedText = [[NSAttributedString alloc]
initWithString:messageText
attributes:@{ NSFontAttributeName: [self fontOfMessage] }];
CGRect rect = [attributedText boundingRectWithSize:CGSizeMake(self.tableView.bounds.size.width - 30, FLT_MAX)
options:NSStringDrawingUsesLineFragmentOrigin
context:nil];
return rect.size.height + kSPUILoggerMessageMargin;
Thanks @giummy!
your welcome! :)