I have the following code that works flawlessly in iOS 6, the problem is that it has no effect in iOS 7. How to apply kerning and line spacing in iOS 7?
+ (NSAttributedString *)attributedText:(NSString *)text inFont:(UIFont *)font { NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:text]; NSMutableParagraphStyle *style = [NSMutableParagraphStyle new]; style.lineSpacing = 5; CGFloat kernSize = -0.6; [attributedString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, text.length)]; [attributedString addAttribute:NSKernAttributeName value:@(kernSize) range:NSMakeRange(0, text.length)]; return attributedString; }
source share