From 9dc7f5d2b6bed4a1f492011a268dd4cf9219f283 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Fri, 7 Aug 2020 18:35:37 -0400 Subject: [PATCH] Top Alert Accessibility changes --- .../AlertHandling/MVMCoreTopAlertOperation.m | 16 ++++++++-------- .../AlertHandling/MVMCoreTopAlertViewProtocol.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m index 50f296c..ccf7545 100644 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m +++ b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertOperation.m @@ -121,11 +121,11 @@ if (self.isCancelled) { // Cancelled, dismiss immediately. - [self dismissAlertView:YES]; + [self dismissAlertView:YES forceful:YES]; } else if (self.isPaused) { // Paused, dismiss for the time being if persistent. - [self dismissAlertView:!self.topAlertObject.persistent]; + [self dismissAlertView:!self.topAlertObject.persistent forceful:YES]; } else if (!self.topAlertObject.persistent) { // Set timer to dismiss top alert if it's not persistent (or it's survival mode and not short bar). @@ -141,7 +141,7 @@ if (weakSelf.isFinished || [weakSelf checkAndHandleForCancellation]) { return; } - [weakSelf dismissAlertView:YES]; + [weakSelf dismissAlertView:YES forceful:NO]; }); } }]; @@ -159,19 +159,19 @@ if (!self.isAnimating) { if (self.isDisplayed) { - [self dismissAlertView:YES]; + [self dismissAlertView:YES forceful:YES]; } else if (self.isExecuting) { [self markAsFinished]; } } } -- (void)dismissAlertView:(BOOL)andFinish { +- (void)dismissAlertView:(BOOL)andFinish forceful:(BOOL)forceful { if (self.isDisplayed && !self.isAnimating) { // Dismisses. - [[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] hideAlertView:^(BOOL finished) { + [[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] hideAlertView:forceful completionHandler:^(BOOL finished) { self.displayed = NO; if (andFinish) { @@ -188,7 +188,7 @@ self.paused = YES; [self didChangeValueForKey:@"isPaused"]; } - [self dismissAlertView:!self.topAlertObject.persistent]; + [self dismissAlertView:!self.topAlertObject.persistent forceful:YES]; } - (void)unpause { @@ -214,7 +214,7 @@ } - (void)topAlertCloseButtonPressed { - [self dismissAlertView:YES]; + [self dismissAlertView:YES forceful:YES]; } @end diff --git a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h index 6f21c40..f667037 100644 --- a/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h +++ b/MVMCore/MVMCore/AlertHandling/MVMCoreTopAlertViewProtocol.h @@ -17,7 +17,7 @@ - (void)showWithTopAlertObject:(nullable MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nonnull id )animationDelegate completionHandler:(void (^ __nullable)(BOOL finished))completionHandler; // Hides -- (void)hideAlertView:(void (^ __nullable)(BOOL finished))completionHandler; +- (void)hideAlertView:(BOOL)forceful completionHandler:(void (^ __nullable)(BOOL finished))completionHandler; // Collapses the notification if it has a short top message. Otherwise removes notification. - (void)collapseNotification;