diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m index 85db522b..5b87d163 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertMainView.m @@ -170,7 +170,7 @@ if (closeButton && !self.closeButton) { self.closeButton = [self addCloseButtonWithAnimationDelegate:animationDelegate]; - [self.closeButton setTintColor:self.contentColor ?:[UIColor whiteColor]]; + [self.closeButton setTintColor:self.contentColor ?: [UIColor whiteColor]]; } else if (!closeButton && self.closeButton) { [self.closeButton removeFromSuperview]; self.closeButton = nil; @@ -241,11 +241,17 @@ - (void)setupWithMessage:(nullable NSString *)message subMessage:(nullable NSString *)subMessage color:(nullable UIColor *)color buttonTitle:(nullable NSString *)buttonTitle userActionHandler:(nullable void (^)(id _Nonnull sender))userActionHandler { self.message = message; self.subMessage = subMessage; + self.contentColor = color; [MVMCoreDispatchUtility performBlockOnMainThread:^{ // Sets the string self.label.attributedText = [MVMCoreUITopAlertBaseView getStringForMessage:message subMessage:subMessage color:color]; + // Sets the color + if (color) { + [self.closeButton setTintColor:color]; + } + // Sets the button [self setupButtonWithButtonTitle:buttonTitle userActionHandler:userActionHandler]; }]; @@ -294,8 +300,8 @@ if ([self init]) { self.backgroundColor = color; [self setupViewWithLabelAndImage:nil topImage:nil]; - [self setupCloseButton:closeButton animationDelegate:animationDelegate]; [self setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:nil userActionHandler:NULL]; + [self setupCloseButton:closeButton animationDelegate:animationDelegate]; } return self; }