review feedback

This commit is contained in:
Scott Pfeil 2023-04-18 11:33:47 -04:00
parent 800cc7671a
commit ba14681a39
3 changed files with 29 additions and 28 deletions

View File

@ -18,7 +18,7 @@ public class TopNotificationHandler {
return MVMCoreActionUtility.fatalClassCheck(object: CoreUIObject.sharedInstance()?.topNotificationHandler)
}
init() {
public init() {
registerWithNotificationCenter()
registerForPageChanges()
}

View File

@ -88,6 +88,7 @@ public struct AlertModel: Codable, Identifiable {
public init(title: String, message: String, buttonModels: [AlertButtonModel], style: UIAlertController.Style = .alert, delegateObject: DelegateObject?, id: String = UUID().uuidString) {
self.title = title
self.message = message
self.buttonModels = buttonModels
actions = buttonModels.map({ alertButtonModel in
return alertButtonModel.generateAction(delegateObject: delegateObject)
})

View File

@ -164,34 +164,34 @@
}
// Do nothing if paused
if (!self.isPaused) {
// Show
if (![[CoreUIObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) {
// Needs to be a top alert view....
[self markAsFinished];
} else {
UIView <MVMCoreTopAlertViewProtocol>*topAlertView = [[CoreUIObject sharedInstance].globalTopAlertDelegate getTopAlertView];
[topAlertView showWithTopAlertObject:self.topAlertObject animationDelegate:self completionHandler:^(BOOL finished) {
self.displayed = YES;
if (self.isCancelled) {
// Cancelled, dismiss immediately.
[self dismissAlertView:YES];
} else if (self.isPaused) {
// Paused, dismiss for the time being if persistent.
[self dismissAlertView:YES];
} else {
[self updateDismissTimer];
}
}];
}
} else {
[self pause];
if (self.isPaused) {
return;
}
// Show
if (![[CoreUIObject sharedInstance].globalTopAlertDelegate respondsToSelector:@selector(getTopAlertView)]) {
// Needs to be a top alert view....
[self markAsFinished];
return;
}
UIView <MVMCoreTopAlertViewProtocol>*topAlertView = [[CoreUIObject sharedInstance].globalTopAlertDelegate getTopAlertView];
[topAlertView showWithTopAlertObject:self.topAlertObject animationDelegate:self completionHandler:^(BOOL finished) {
self.displayed = YES;
if (self.isCancelled) {
// Cancelled, dismiss immediately.
[self dismissAlertView:YES];
} else if (self.isPaused) {
// Paused, dismiss for the time being if persistent.
[self dismissAlertView:YES];
} else {
[self updateDismissTimer];
}
}];
}
/// Updates the timer to dismiss the top alert.