Skip to content

Commit

Permalink
Add option to set custom tint color for icon image.
Browse files Browse the repository at this point in the history
  • Loading branch information
wzs committed Feb 18, 2015
1 parent f6081fd commit de63437
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions SCLAlertView/SCLAlertView.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ typedef NS_ENUM(NSInteger, SCLAlertViewBackground)
*/
@property (nonatomic, strong) UIColor *backgroundViewColor;

/** Set custom tint color for icon image.
*
* SCLAlertView icon tint color
*/
@property (nonatomic, strong) UIColor *iconTintColor;

/** Warns that alerts is gone
*
* Warns that alerts is gone using block
Expand Down
6 changes: 5 additions & 1 deletion SCLAlertView/SCLAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,11 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
}
else
{
self.circleIconImageView.image = iconImage;
if (self.iconTintColor) {
self.circleIconImageView.tintColor = self.iconTintColor;
iconImage = [iconImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
self.circleIconImageView.image = iconImage;
}

for (UITextField *textField in _inputs)
Expand Down

0 comments on commit de63437

Please sign in to comment.