Skip to content

Commit

Permalink
Fix double-drawing on IB-created instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbpowell committed May 17, 2014
1 parent 93ae1f3 commit 008982d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MarqueeLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ - (id)initWithFrame:(CGRect)frame rate:(CGFloat)pixelsPerSec andFadeLength:(CGFl
}

- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder: aDecoder];
self = [super initWithCoder:aDecoder];
if (self) {
[self setupLabel];

Expand All @@ -165,6 +165,10 @@ - (void)forwardPropertiesToSubLabel {
[self.subLabel setValue:val forKey:property];
}
[self setText:[super text]];

// Clear super text, in the case of IB-created labels, to prevent double-drawing
[super setText:nil];

[self setFont:[super font]];
}

Expand Down

0 comments on commit 008982d

Please sign in to comment.