Last active
January 13, 2016 08:09
-
-
Save phynet/c9009a2e5493853e9edf to your computer and use it in GitHub Desktop.
Category to create an attributed label for Obj-c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UILabel (AttributedLabel) | |
-(NSAttributedString*)spaceBetweenChars:(int)spaceValue{ | |
NSMutableAttributedString *attributedString; | |
attributedString = [[NSMutableAttributedString alloc] initWithString:self.text]; | |
[attributedString addAttribute:NSKernAttributeName value:@(spaceValue) range:NSMakeRange(0, 0)]; | |
[self setAttributedText:attributedString]; | |
return self.attributedText; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment