review changes
This commit is contained in:
parent
67cd073173
commit
800cc7671a
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import MVMCore
|
||||
|
||||
public class AlertController: UIAlertController {
|
||||
@objc dynamic public var visible = false
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user