Browse files

Add the possibility of customizing the textcolor of the labels

Signed-off-by: Marc Lefrançois <mlefrancois@mirego.com>
  • Loading branch information...
1 parent 22c4d75 commit cefe1b4a2dfda92893c49c8b298788d4eef52b02 @marclefrancois marclefrancois committed Jun 13, 2013
Showing with 10 additions and 11 deletions.
  1. +1 −2 MTStatusBarOverlay.h
  2. +9 −9 MTStatusBarOverlay.m
View
3 MTStatusBarOverlay.h
@@ -116,8 +116,7 @@ typedef enum MTMessageType {
@property (nonatomic, copy) NSString *detailText;
// the delegate of the overlay
@property (nonatomic, unsafe_unretained) id<MTStatusBarOverlayDelegate> delegate;
-
-
+@property(nonatomic, strong) UIColor *customTextColor;
//===========================================================
#pragma mark -
#pragma mark Class Methods
View
18 MTStatusBarOverlay.m
@@ -1230,19 +1230,19 @@ - (void)setColorSchemeForStatusBarStyle:(UIStatusBarStyle)style messageType:(MTM
// set color of labels depending on messageType
switch(messageType) {
case MTMessageTypeFinish:
- self.statusLabel1.textColor = kDarkThemeFinishedMessageTextColor;
- self.statusLabel2.textColor = kDarkThemeFinishedMessageTextColor;
- self.finishedLabel.textColor = kDarkThemeFinishedMessageTextColor;
+ self.statusLabel1.textColor = self.customTextColor ? self.customTextColor: kDarkThemeFinishedMessageTextColor;
+ self.statusLabel2.textColor = self.customTextColor ? self.customTextColor: kDarkThemeFinishedMessageTextColor;
+ self.finishedLabel.textColor = self.customTextColor ? self.customTextColor: kDarkThemeFinishedMessageTextColor;
break;
case MTMessageTypeError:
- self.statusLabel1.textColor = kDarkThemeErrorMessageTextColor;
- self.statusLabel2.textColor = kDarkThemeErrorMessageTextColor;
- self.finishedLabel.textColor = kDarkThemeErrorMessageTextColor;
+ self.statusLabel1.textColor = self.customTextColor ? self.customTextColor: kDarkThemeErrorMessageTextColor;
+ self.statusLabel2.textColor = self.customTextColor ? self.customTextColor: kDarkThemeErrorMessageTextColor;
+ self.finishedLabel.textColor = self.customTextColor ? self.customTextColor: kDarkThemeErrorMessageTextColor;
break;
default:
- self.statusLabel1.textColor = kDarkThemeTextColor;
- self.statusLabel2.textColor = kDarkThemeTextColor;
- self.finishedLabel.textColor = kDarkThemeTextColor;
+ self.statusLabel1.textColor = self.customTextColor ? self.customTextColor: kDarkThemeTextColor;
+ self.statusLabel2.textColor = self.customTextColor ? self.customTextColor: kDarkThemeTextColor;
+ self.finishedLabel.textColor = self.customTextColor ? self.customTextColor: kDarkThemeTextColor;
break;
}
self.statusLabel1.shadowColor = nil;

0 comments on commit cefe1b4

Please sign in to comment.