change order of code

This commit is contained in:
panxi 2019-04-17 15:20:56 -04:00
parent 575721589a
commit e59adf7e47

View File

@ -245,11 +245,12 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed.";
}
- (void)resetDefaultBackgroundColor:(UIColor *)backgroundColor basedOnStatusBarStyle:(UIStatusBarStyle)style {
UIColor *defaultStatusBarBackgroundColor = backgroundColor;
if (!defaultStatusBarBackgroundColor) {
defaultStatusBarBackgroundColor = style == UIStatusBarStyleDefault ? [UIColor whiteColor] : [UIColor blackColor];
}
if (!self.topAlertObject) {
UIColor *defaultStatusBarBackgroundColor = backgroundColor;
if (!defaultStatusBarBackgroundColor) {
defaultStatusBarBackgroundColor = style == UIStatusBarStyleDefault ? [UIColor whiteColor] : [UIColor blackColor];
}
//color doesn't match the current default value
if (!CGColorEqualToColor(defaultStatusBarBackgroundColor.CGColor, self.statusBarView.backgroundColor.CGColor)) {
self.statusBarView.backgroundColor = defaultStatusBarBackgroundColor;