[objective-c]UILabelの文字間を設定

UILabelの文字間を設定

-(void)setLetterSpacing:(UILabel*)label letterSpacing:(float)letterSpacing{
    NSMutableAttributedString* attributedText= [[NSMutableAttributedString alloc] initWithString:label.text];
    [attributedText addAttribute:NSKernAttributeName
                           value:[NSNumber numberWithFloat:letterSpacing]
                           range:NSMakeRange(0, attributedText.length)];
    label.attributedText = attributedText;
}