diff --git a/MVMCore/MVMCore/ActionHandling/ActionActionsModel.swift b/MVMCore/MVMCore/ActionHandling/ActionActionsModel.swift index 33444c0..c7e00fc 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionActionsModel.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionActionsModel.swift @@ -8,7 +8,7 @@ import Foundation -open class ActionActionsModel: ActionModelProtocol { +public struct ActionActionsModel: ActionModelProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- @@ -46,7 +46,7 @@ open class ActionActionsModel: ActionModelProtocol { // MARK: - Codec //-------------------------------------------------- - required public init(from decoder: Decoder) throws { + public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) actions = try typeContainer.decodeModels(codingKey: .actions) if let concurrent = try typeContainer.decodeIfPresent(Bool.self, forKey: .concurrent) { diff --git a/MVMCore/MVMCore/ActionHandling/ActionOpenPageModel.swift b/MVMCore/MVMCore/ActionHandling/ActionOpenPageModel.swift index c6a2b9a..c51b3fd 100644 --- a/MVMCore/MVMCore/ActionHandling/ActionOpenPageModel.swift +++ b/MVMCore/MVMCore/ActionHandling/ActionOpenPageModel.swift @@ -8,27 +8,27 @@ import Foundation -open class ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, ClientParameterActionProtocol { +public struct ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, ClientParameterActionProtocol { //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- - open class var identifier: String { "openPage" } - open var actionType: String = identifier - open var pageType: String - open var modules: [String]? - open var baseURL: URL? - open var appContext: String? - open var requestURL: URL? - open var extraParameters: JSONValueDictionary? - open var analyticsData: JSONValueDictionary? - open var presentationStyle: String? - open var tabBarIndex: Int? - open var background: Bool? - open var clientParameters: ClientParameterModel? - open var customTimeoutTime: TimeInterval? + public static var identifier: String = "openPage" + public var actionType: String = identifier + public var pageType: String + public var modules: [String]? + public var baseURL: URL? + public var appContext: String? + public var requestURL: URL? + public var extraParameters: JSONValueDictionary? + public var analyticsData: JSONValueDictionary? + public var presentationStyle: String? + public var tabBarIndex: Int? + public var background: Bool? + public var clientParameters: ClientParameterModel? + public var customTimeoutTime: TimeInterval? - open var requestParameters: MVMCoreRequestParameters + public var requestParameters: MVMCoreRequestParameters //-------------------------------------------------- // MARK: - Initialzier @@ -95,7 +95,7 @@ open class ActionOpenPageModel: ActionModelProtocol, ActionOpenPageProtocol, Cli requestParameters.actionMap = toJSON() } - open func encode(to encoder: Encoder) throws { + public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(pageType, forKey: .pageType) try container.encodeIfPresent(baseURL, forKey: .baseURL) diff --git a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.swift b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.swift index 223ce20..398a590 100644 --- a/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.swift +++ b/MVMCore/MVMCore/ActionHandling/MVMCoreActionHandler.swift @@ -148,7 +148,7 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol { /// Legacy handle action with json. @objc(handleActionWithDictionary:additionalData:delegateObject:) open func handleAction(with json: [AnyHashable: Any]?, additionalData: [AnyHashable: Any]?, delegateObject: DelegateObject?) { - let task = Task(priority: .userInitiated) { + _ = Task(priority: .userInitiated) { try Task.checkCancellation() do { guard let json = json else { @@ -172,15 +172,6 @@ public protocol MVMCoreJSONActionHandlerProtocol: MVMCoreActionHandlerProtocol { } } } - Task { - let result = await task.result - do { - try result.get() - print("ActionHandler: task done") - } catch { - print("ActionHandler: \(error)") - } - } } /// Bridges the legacy json using functions and the new model using functions.