From 800cc7671ae9095cadab1cfa15d4f7299a75b89f Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Tue, 18 Apr 2023 11:16:55 -0400 Subject: [PATCH] review changes --- MVMCoreUI/Alerts/AlertController.swift | 1 + MVMCoreUI/Alerts/AlertHandler.swift | 2 +- MVMCoreUI/Alerts/TopNotificationHandler.swift | 4 ++-- MVMCoreUI/Atomic/Actions/AlertModel.swift | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MVMCoreUI/Alerts/AlertController.swift b/MVMCoreUI/Alerts/AlertController.swift index 955fcb8c..3119face 100644 --- a/MVMCoreUI/Alerts/AlertController.swift +++ b/MVMCoreUI/Alerts/AlertController.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore public class AlertController: UIAlertController { @objc dynamic public var visible = false diff --git a/MVMCoreUI/Alerts/AlertHandler.swift b/MVMCoreUI/Alerts/AlertHandler.swift index d2240cb7..abd087e8 100644 --- a/MVMCoreUI/Alerts/AlertHandler.swift +++ b/MVMCoreUI/Alerts/AlertHandler.swift @@ -10,7 +10,7 @@ import MVMCore public class AlertHandler { - /// Returns the action handler stored in the CoreUIObject + /// Returns the handler stored in the CoreUIObject public static func shared() -> Self { return MVMCoreActionUtility.fatalClassCheck(object: CoreUIObject.sharedInstance()?.alertHandler) } diff --git a/MVMCoreUI/Alerts/TopNotificationHandler.swift b/MVMCoreUI/Alerts/TopNotificationHandler.swift index 19970997..c711fb3e 100644 --- a/MVMCoreUI/Alerts/TopNotificationHandler.swift +++ b/MVMCoreUI/Alerts/TopNotificationHandler.swift @@ -10,10 +10,10 @@ import MVMCore public class TopNotificationHandler { - /// The operation queue of alert operations. + /// The operation queue of top notification operations. private var queue = OperationQueue() - /// Returns the action handler stored in the CoreUIObject + /// Returns the handler stored in the CoreUIObject public static func shared() -> Self { return MVMCoreActionUtility.fatalClassCheck(object: CoreUIObject.sharedInstance()?.topNotificationHandler) } diff --git a/MVMCoreUI/Atomic/Actions/AlertModel.swift b/MVMCoreUI/Atomic/Actions/AlertModel.swift index 4f22cfc7..b1428b99 100644 --- a/MVMCoreUI/Atomic/Actions/AlertModel.swift +++ b/MVMCoreUI/Atomic/Actions/AlertModel.swift @@ -69,7 +69,7 @@ public struct AlertModel: Codable, Identifiable { public var message: String public var style: UIAlertController.Style = .alert public var actions: [UIAlertAction] - public var alertActions: [AlertButtonModel]? + public var buttonModels: [AlertButtonModel]? public var analyticsData: JSONValueDictionary? public var id: String @@ -117,8 +117,8 @@ public struct AlertModel: Codable, Identifiable { let delegateObject = try decoder.get() title = try typeContainer.decode(String.self, forKey: .title) message = try typeContainer.decode(String.self, forKey: .message) - alertActions = try typeContainer.decode([AlertButtonModel].self, forKey: .alertActions) - actions = alertActions!.map({ alertButtonModel in + buttonModels = try typeContainer.decode([AlertButtonModel].self, forKey: .alertActions) + actions = buttonModels!.map({ alertButtonModel in return alertButtonModel.generateAction(delegateObject: delegateObject) }) analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData) @@ -133,7 +133,7 @@ public struct AlertModel: Codable, Identifiable { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(title, forKey: .title) try container.encode(message, forKey: .message) - try container.encodeIfPresent(alertActions, forKey: .alertActions) + try container.encodeIfPresent(buttonModels, forKey: .alertActions) try container.encode(style.rawValueString, forKey: .style) try container.encodeIfPresent(analyticsData, forKey: .analyticsData) try container.encode(id, forKey: .id)