Permalink
Browse files

only update the title and title color if there's a non-nil value for

them
  • Loading branch information...
1 parent a8670dc commit 844b3a8d1aa728c7440cf9409471fad2c017899f @joshaber joshaber committed May 31, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/UIKit/TUIButton.m
View
12 lib/UIKit/TUIButton.m
@@ -205,8 +205,16 @@ - (void)drawRect:(CGRect)r
[image drawInRect:imageRect blendMode:kCGBlendModeNormal alpha:alpha];
}
- _titleView.text = self.currentTitle;
- _titleView.textColor = self.currentTitleColor;
+ NSString *title = self.currentTitle;
+ if(title != nil) {
+ _titleView.text = title;
+ }
+
+ TUIColor *color = self.currentTitleColor;
+ if(color != nil) {
+ _titleView.textColor = color;
+ }
+
TUIColor *shadowColor = self.currentTitleShadowColor;
// they may have manually set the renderer's shadow color, in which case we
// don't want to reset it to nothing

0 comments on commit 844b3a8

Please sign in to comment.