diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m index 3d2fb626..6753e67c 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.m @@ -46,9 +46,6 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed."; @property (weak, nonatomic) MVMCoreUITopAlertExpandableView *topAlertClearspotView; @property (strong, nonatomic) NSString *time; -@property (nonatomic, assign) UIStatusBarStyle defaultStatusBarStyle; -@property (nonatomic, strong) UIColor *defaultStatusBarBackgroundColor; - @end @implementation MVMCoreUITopAlertView @@ -207,7 +204,8 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed."; completionHandler(finished); weakSelf.topAlertObject = nil; [MVMCoreDispatchUtility performBlockOnMainThread:^{ - [weakSelf resetDefaultStatusBarStyle:weakSelf.defaultStatusBarStyle backgroundColor:weakSelf.defaultStatusBarBackgroundColor]; + MVMCoreUISplitViewController *mainsplit = [MVMCoreUISplitViewController mainSplitViewController]; + [weakSelf resetDefaultStatusBarStyle:[mainsplit getDefaultStatusBarStyle] backgroundColor:[mainsplit getDefaultStatusBarBackgroundColor]]; }]; }]; }]; @@ -248,15 +246,14 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed."; } - (void)resetDefaultStatusBarStyle:(UIStatusBarStyle)style backgroundColor:(UIColor *)backgroundColor { - self.defaultStatusBarStyle = style; - self.defaultStatusBarBackgroundColor = backgroundColor; - if (!backgroundColor) { - self.defaultStatusBarBackgroundColor = style == UIStatusBarStyleDefault ? [UIColor whiteColor] : [UIColor blackColor]; + UIColor *defaultStatusBarBackgroundColor = backgroundColor; + if (!defaultStatusBarBackgroundColor) { + defaultStatusBarBackgroundColor = style == UIStatusBarStyleDefault ? [UIColor whiteColor] : [UIColor blackColor]; } if (!self.topAlertObject) { //style or color doens't match the current default value - if (style != self.statusBarStyle || !CGColorEqualToColor(self.defaultStatusBarBackgroundColor.CGColor, self.statusBarView.backgroundColor.CGColor)) { - [self setStatusBarColor:self.defaultStatusBarBackgroundColor statusBarStyle:style]; + if (style != self.statusBarStyle || !CGColorEqualToColor(defaultStatusBarBackgroundColor.CGColor, self.statusBarView.backgroundColor.CGColor)) { + [self setStatusBarColor:defaultStatusBarBackgroundColor statusBarStyle:style]; } } }