Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
Code refactoring and reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Jul 2, 2012
1 parent 330898d commit 8024e43
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions TTTAttributedLabel.m
Expand Up @@ -165,19 +165,6 @@ @implementation TTTAttributedLabel
@synthesize verticalAlignment = _verticalAlignment;
@synthesize tapGestureRecognizer = _tapGestureRecognizer;

- (UIColor*)textColor
{
UIColor *clr = [super textColor];

if(!clr)
{
clr = [UIColor blackColor];
self.textColor = clr;
}

return clr;
}

- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
Expand Down Expand Up @@ -613,6 +600,16 @@ - (void)setHighlighted:(BOOL)highlighted {
[self setNeedsDisplay];
}

// Fixes crash when loading from a UIStoryboard
- (UIColor *)textColor {
UIColor *color = [super textColor];
if (!color) {
color = [UIColor blackColor];
}

return color;
}

- (CGRect)textRectForBounds:(CGRect)bounds limitedToNumberOfLines:(NSInteger)numberOfLines {
if (!self.attributedText) {
return [super textRectForBounds:bounds limitedToNumberOfLines:numberOfLines];
Expand Down

0 comments on commit 8024e43

Please sign in to comment.