added new function hideTopAlertViewOfType

This commit is contained in:
Krishna Kishore Bandaru 2021-11-11 23:11:31 +05:30
parent e1261d9e4d
commit 2b5ce09b10
2 changed files with 16 additions and 0 deletions

View File

@ -101,6 +101,9 @@
/// Hides the current alert view.
- (void)hideTopAlertView;
/// Hides a persistent alert based on the type string.
- (void)hidePersistentTopAlertViewOfType:(nullable NSString *)type;
/// Hides a alert based on the type string.
- (void)hideTopAlertViewOfType:(nullable NSString *)type;

View File

@ -226,6 +226,19 @@
return hasAlert;
}
- (void)hidePersistentTopAlertViewOfType:(nullable NSString *)type {
if (type) {
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {
// Cancel all persistent operations of this type.
if (operation.topAlertObject.persistent && [operation.topAlertObject.type isEqualToString:type]) {
operation.reAddAfterCancel = NO;
[operation cancel];
}
}
}
}
- (void)hideTopAlertViewOfType:(nullable NSString *)type {
if (type) {
for (MVMCoreTopAlertOperation *operation in self.topAlertQueue.operations) {