I recently upgraded my application to iOS 7 using Xcode 5 and found that boundingRectWithSize gives a different height (in terms of size) that computes the bounds of attribute strings.
The following line gives me different results between iOS 6 and iOS 7:
CGRect rect = [self boundingRectWithSize:CGSizeMake(inWidth, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil];
"self" is the NSAttributedString, and "inWidth" is the maximum width in pixels that the string should fit.
I think this is because iOS 7 has a different font handling than iOS 6.
Has anyone got a working solution for calculating line height on both versions of iOS?
source share