Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

them
  • Loading branch information...
commit 844b3a8d1aa728c7440cf9409471fad2c017899f 1 parent a8670dc
@joshaber joshaber authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.