From 47dfb10b62dac612c987075c13e131799bea37f5 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Fri, 26 May 2023 14:35:17 -0400 Subject: [PATCH] Change name to NotificationHandler --- MVMCoreUI.xcodeproj/project.pbxproj | 8 ++++---- MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift | 2 +- .../Atomic/Actions/ActionTopNotificationHandler.swift | 2 +- ...otificationHandler.swift => NotificationHandler.swift} | 8 ++++---- MVMCoreUI/OtherHandlers/CoreUIObject.swift | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) rename MVMCoreUI/Notification/{TopNotificationHandler.swift => NotificationHandler.swift} (98%) diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index 3a14d2ad..5a04c734 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -291,7 +291,7 @@ AF7E509829E477C1009DC2AD /* AlertHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7E509629E477C0009DC2AD /* AlertHandler.swift */; }; AF7E509929E477C1009DC2AD /* AlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF7E509729E477C0009DC2AD /* AlertController.swift */; }; AFA4932029E5CA73001A9663 /* AlertOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4931F29E5CA73001A9663 /* AlertOperation.swift */; }; - AFA4932229E5EF2E001A9663 /* TopNotificationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4932129E5EF2E001A9663 /* TopNotificationHandler.swift */; }; + AFA4932229E5EF2E001A9663 /* NotificationHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4932129E5EF2E001A9663 /* NotificationHandler.swift */; }; AFA4933F29E874F0001A9663 /* MVMCoreUILoggingDelegateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4933E29E874F0001A9663 /* MVMCoreUILoggingDelegateProtocol.swift */; }; AFA4935729EE3DCC001A9663 /* AlertDelegateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFA4935629EE3DCC001A9663 /* AlertDelegateProtocol.swift */; }; AFE4A1D127DFB5EE00C458D0 /* VDSColorTokens.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AFE4A1D027DFB5EE00C458D0 /* VDSColorTokens.xcframework */; }; @@ -895,7 +895,7 @@ AF7E509629E477C0009DC2AD /* AlertHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertHandler.swift; sourceTree = ""; }; AF7E509729E477C0009DC2AD /* AlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertController.swift; sourceTree = ""; }; AFA4931F29E5CA73001A9663 /* AlertOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertOperation.swift; sourceTree = ""; }; - AFA4932129E5EF2E001A9663 /* TopNotificationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopNotificationHandler.swift; sourceTree = ""; }; + AFA4932129E5EF2E001A9663 /* NotificationHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationHandler.swift; sourceTree = ""; }; AFA4933E29E874F0001A9663 /* MVMCoreUILoggingDelegateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMCoreUILoggingDelegateProtocol.swift; sourceTree = ""; }; AFA4935629EE3DCC001A9663 /* AlertDelegateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertDelegateProtocol.swift; sourceTree = ""; }; AFE4A1D027DFB5EE00C458D0 /* VDSColorTokens.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = VDSColorTokens.xcframework; path = ../SharedFrameworks/VDSColorTokens.xcframework; sourceTree = ""; }; @@ -2153,7 +2153,7 @@ D29DF11E21E6851E003B2FB9 /* Notification */ = { isa = PBXGroup; children = ( - AFA4932129E5EF2E001A9663 /* TopNotificationHandler.swift */, + AFA4932129E5EF2E001A9663 /* NotificationHandler.swift */, D2ED2814254B0EE400A1C293 /* MVMCoreGlobalTopAlertDelegateProtocol.h */, D2ED2809254B0EB700A1C293 /* MVMCoreTopAlertDelegateProtocol.h */, D2ED280A254B0EB700A1C293 /* MVMCoreTopAlertObject.h */, @@ -3023,7 +3023,7 @@ D20C7009250BF99B0095B21C /* TopNotificationModel.swift in Sources */, D29C558A25C05C7D0082E7D6 /* BGVideoImageMoleculeModel.swift in Sources */, 8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */, - AFA4932229E5EF2E001A9663 /* TopNotificationHandler.swift in Sources */, + AFA4932229E5EF2E001A9663 /* NotificationHandler.swift in Sources */, BB2FB3BD247E7EF200DF73CD /* Tags.swift in Sources */, AA104ADC244734EA004D2810 /* HeadersH1LandingPageHeaderModel.swift in Sources */, BBAA4F03243D8E3B005AAD5F /* RadioBoxes.swift in Sources */, diff --git a/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift b/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift index 82fc0a67..92a7d1e5 100644 --- a/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift +++ b/MVMCoreUI/Atomic/Actions/ActionTopAlertHandler.swift @@ -25,7 +25,7 @@ open class ActionTopAlertHandler: MVMCoreActionHandlerProtocol { let topAlertObject = MVMCoreTopAlertObject(responseInfo: responseInfo)! topAlertObject.delegate = (delegateObject as? MVMCoreUIDelegateObject)?.topAlertDelegate topAlertObject.pageType = model.pageType - TopNotificationHandler.shared().showTopAlert(with: topAlertObject) + NotificationHandler.shared().showTopAlert(with: topAlertObject) continuation.resume() }) } diff --git a/MVMCoreUI/Atomic/Actions/ActionTopNotificationHandler.swift b/MVMCoreUI/Atomic/Actions/ActionTopNotificationHandler.swift index a92158f7..a6b9a223 100644 --- a/MVMCoreUI/Atomic/Actions/ActionTopNotificationHandler.swift +++ b/MVMCoreUI/Atomic/Actions/ActionTopNotificationHandler.swift @@ -15,6 +15,6 @@ open class ActionTopNotificationHandler: MVMCoreActionHandlerProtocol { open func execute(with model: ActionModelProtocol, delegateObject: DelegateObject?, additionalData: [AnyHashable : Any]?) async throws { guard let model = model as? ActionTopNotificationModel else { return } - TopNotificationHandler.shared().showTopNotification(with: model.topNotification) + NotificationHandler.shared().showTopNotification(with: model.topNotification) } } diff --git a/MVMCoreUI/Notification/TopNotificationHandler.swift b/MVMCoreUI/Notification/NotificationHandler.swift similarity index 98% rename from MVMCoreUI/Notification/TopNotificationHandler.swift rename to MVMCoreUI/Notification/NotificationHandler.swift index 7a00568b..fc6227aa 100644 --- a/MVMCoreUI/Notification/TopNotificationHandler.swift +++ b/MVMCoreUI/Notification/NotificationHandler.swift @@ -235,7 +235,7 @@ public class NotificationOperation: MVMCoreOperation { } } -public class TopNotificationHandler { +public class NotificationHandler { /// The operation queue of top notification operations. private var queue = OperationQueue() @@ -274,7 +274,7 @@ public class TopNotificationHandler { // Dismiss any top alerts that server wants us to dismiss/ if let disableType = loadObject.responseInfoMap?.optionalStringForKey("disableType") { - TopNotificationHandler.shared().hideTopAlertView(of: disableType) + NotificationHandler.shared().hideTopAlertView(of: disableType) } // Show any new top alert. @@ -389,7 +389,7 @@ public class TopNotificationHandler { let object = model.createTopAlertObject() guard !checkAndUpdateExisting(with: object), let operation = MVMCoreTopAlertOperation(topAlertObject: object) else { return } - TopNotificationHandler.shared().add(operation: operation) + NotificationHandler.shared().add(operation: operation) } /// Show the top alert with the legacy object. @@ -444,7 +444,7 @@ public class TopNotificationHandler { } } -extension TopNotificationHandler: MVMCorePresentationDelegateProtocol { +extension NotificationHandler: MVMCorePresentationDelegateProtocol { // Update displayable for each top alert operation when page type changes, in top queue priority order. public func navigationController(_ navigationController: UINavigationController, displayedViewController viewController: UIViewController) { guard queue.operations.count > 0 else { return } diff --git a/MVMCoreUI/OtherHandlers/CoreUIObject.swift b/MVMCoreUI/OtherHandlers/CoreUIObject.swift index 0cf9f1d4..358e74ad 100644 --- a/MVMCoreUI/OtherHandlers/CoreUIObject.swift +++ b/MVMCoreUI/OtherHandlers/CoreUIObject.swift @@ -11,7 +11,7 @@ import MVMCore @objcMembers open class CoreUIObject: MVMCoreObject { public var alertHandler: AlertHandler? - public var topNotificationHandler: TopNotificationHandler? + public var topNotificationHandler: NotificationHandler? open override func defaultInitialSetup() { CoreUIModelMapping.registerObjects() @@ -25,6 +25,6 @@ import MVMCore viewControllerMapping = MVMCoreUIViewControllerMappingObject() loggingDelegate = MVMCoreUILoggingHandler() alertHandler = AlertHandler() - topNotificationHandler = TopNotificationHandler() + topNotificationHandler = NotificationHandler() } }