added new function hideTopAlertViewOfType
This commit is contained in:
parent
e1261d9e4d
commit
2b5ce09b10
@ -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;
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user