Skip to content

Commit

Permalink
Merge pull request #6 from vsanthanam/revert-5-alert-background-color
Browse files Browse the repository at this point in the history
Revert "change the background color of alerts"
  • Loading branch information
vsanthanam committed Apr 10, 2018
2 parents faf2f83 + 1950bc5 commit 1d49bbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
5 changes: 0 additions & 5 deletions VSAlert/VSAlertController.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ typedef NS_ENUM(NSInteger, VSAlertControllerAnimationStyle) {
@name Configuring Alert Appearance
*/

/**
The background color of the alert.
*/
@property (NS_NONATOMIC_IOSONLY, strong, nonnull) UIColor *alertBackgroundColor UI_APPEARANCE_SELECTOR;

/**
The color of the alert title. The default value is black.
*/
Expand Down
21 changes: 2 additions & 19 deletions VSAlert/VSAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

@interface VSAlertControllerAppearanceProxy : UIView<UIAppearance>

@property (NS_NONATOMIC_IOSONLY, strong, nonnull) UIColor *alertBackgroundColor UI_APPEARANCE_SELECTOR;
@property (NS_NONATOMIC_IOSONLY, strong, nonnull) UIColor *alertTitleTextColor UI_APPEARANCE_SELECTOR;
@property (NS_NONATOMIC_IOSONLY, strong, nonnull) UIColor *alertMessageTextColor UI_APPEARANCE_SELECTOR;
@property (NS_NONATOMIC_IOSONLY, strong, nonnull) UIFont *alertTitleTextFont UI_APPEARANCE_SELECTOR;
Expand All @@ -30,7 +29,6 @@ @interface VSAlertControllerAppearanceProxy : UIView<UIAppearance>

@implementation VSAlertControllerAppearanceProxy

@synthesize alertBackgroundColor = _alertBackgroundColor;
@synthesize alertTitleTextColor = _alertTitleTextColor;
@synthesize alertTitleTextFont = _alertTitleTextFont;
@synthesize alertMessageTextColor = _alertMessageTextColor;
Expand Down Expand Up @@ -553,7 +551,6 @@ @implementation VSAlertController {
static os_log_t alert_log;

// Explicitly synthesize Ivars from header
@synthesize alertBackgroundColor = _alertBackgroundColor;
@synthesize alertTitleTextColor = _alertTitleTextColor;
@synthesize alertMessageTextColor = _alertMessageTextColor;
@synthesize alertTitleTextFont = _alertTitleTextFont;
Expand Down Expand Up @@ -781,19 +778,6 @@ - (void)viewDidDisappear:(BOOL)animated {

#pragma mark - Property Access Methods

- (UIColor *)alertBackgroundColor {

return _alertBackgroundColor;

}

- (void)setAlertBackgroundColor:(UIColor *)alertBackgroundColor {

_alertBackgroundColor = alertBackgroundColor;
self.alertView.backgroundColor = self.alertBackgroundColor;

}

- (UIColor *)alertTitleTextColor {

return _alertTitleTextColor;
Expand Down Expand Up @@ -1021,8 +1005,7 @@ - (void)_setUpAlertController {
_presentAnimator = [[VSAlertControllerTransitionAnimator alloc] init];
_dismissAnimator = [[VSAlertControllerTransitionAnimator alloc] init];

// Set up propertie without accessors for use with UIAppearance
_alertBackgroundColor = [VSAlertController appearance].alertBackgroundColor ? [VSAlertController appearance].alertBackgroundColor : [UIColor whiteColor];
// Set up propertie without accessors for use with UIAppearance
_alertTitleTextColor = [VSAlertController appearance].alertTitleTextColor ? [VSAlertController appearance].alertTitleTextColor : [UIColor blackColor];
_alertTitleTextFont = [VSAlertController appearance].alertTitleTextFont ? [VSAlertController appearance].alertTitleTextFont : [UIFont systemFontOfSize:17.0f weight:UIFontWeightSemibold];
_alertMessageTextColor = [VSAlertController appearance].alertMessageTextColor ? [VSAlertController appearance].alertMessageTextColor : [UIColor blackColor];
Expand Down Expand Up @@ -1097,7 +1080,7 @@ - (void)_setUpAlertMaskBackground {
- (void)_setUpAlertView {

self.alertView = [[UIView alloc] initWithFrame:CGRectZero];
self.alertView.backgroundColor = self.alertBackgroundColor;
self.alertView.backgroundColor = [UIColor whiteColor];
self.alertView.translatesAutoresizingMaskIntoConstraints = NO;

[self.alertMaskBackground addSubview:self.alertView];
Expand Down

0 comments on commit 1d49bbf

Please sign in to comment.