Krelborn / KILabel

A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable.
MIT License
470 stars 132 forks source link

Can't set custom font or font size. #10

Closed mitchellporter closed 9 years ago

mitchellporter commented 9 years ago

I'm having trouble setting a custom font on my KILabel.

Here's my code:

 self.myLabel = [[KILabel alloc] init];
 self.myLabel.text = @"Some random text";
 self.myLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:12.4];
 self.myLabel.textColor = [UIColor colorWithRed:0.000 green:0.000 blue:0.000 alpha:1];
 [self.myLabel sizeToFit];

Any idea how I can set a custom font and font size?

mitchellporter commented 9 years ago

I just took a closer look at the code and realized I need to be setting the font property before setting the text.