From 4d155b9f97aceda27904a1d0a90f20e35948e3cc Mon Sep 17 00:00:00 2001 From: "Suresh, Kamlesh" Date: Tue, 21 Jan 2020 18:23:32 -0500 Subject: [PATCH] ActionModelProtocol --- MVMCoreUI/Atoms/Buttons/ButtonModel.swift | 4 ++-- MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift | 4 ++-- MVMCoreUI/Atoms/Buttons/LinkModel.swift | 4 ++-- MVMCoreUI/Atoms/Buttons/MFCustomButton+ActionModel.swift | 2 +- MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift | 2 +- MVMCoreUI/Atoms/Views/ToggleModel.swift | 2 +- MVMCoreUI/Models/ModelProtocols/ListItemModelProtocol.swift | 4 ++-- MVMCoreUI/Molecules/Items/ListItemModel.swift | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift index 531859c0..c9a7f2f8 100644 --- a/MVMCoreUI/Atoms/Buttons/ButtonModel.swift +++ b/MVMCoreUI/Atoms/Buttons/ButtonModel.swift @@ -22,13 +22,13 @@ public class ButtonModel: MoleculeModelProtocol { public static var identifier: String = "button" public var backgroundColor: Color? public var title: String - public var action: ActionProtocol + public var action: ActionModelProtocol public var style: ButtonStyle? public var size: ButtonSize? = .standard public var required: Bool? public var requiredGroups: [String]? - init(with title: String, action: ActionProtocol) { + init(with title: String, action: ActionModelProtocol) { self.title = title self.action = action } diff --git a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift index 3612c1fc..04b5aa07 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift @@ -13,12 +13,12 @@ public class CaretLinkModel: MoleculeModelProtocol { public static var identifier: String = "caretLink" public var backgroundColor: Color? public var title: String - public var action: ActionProtocol + public var action: ActionModelProtocol public var enabledColor: Color = Color(uiColor: .black) public var disabledColor: Color? = Color(uiColor: .mfSilver()) public var enabled: Bool = true - public init(title: String, action: ActionProtocol) { + public init(title: String, action: ActionModelProtocol) { self.title = title self.action = action } diff --git a/MVMCoreUI/Atoms/Buttons/LinkModel.swift b/MVMCoreUI/Atoms/Buttons/LinkModel.swift index 27cbd6c6..0c797b21 100644 --- a/MVMCoreUI/Atoms/Buttons/LinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/LinkModel.swift @@ -12,11 +12,11 @@ public class LinkModel: MoleculeModelProtocol { public static var identifier: String = "link" public var backgroundColor: Color? public var title: String - public var action: ActionProtocol + public var action: ActionModelProtocol public var enabled = true public var textColor = Color(uiColor: .mfTextButton()) - public init(title: String, action: ActionProtocol) { + public init(title: String, action: ActionModelProtocol) { self.title = title self.action = action } diff --git a/MVMCoreUI/Atoms/Buttons/MFCustomButton+ActionModel.swift b/MVMCoreUI/Atoms/Buttons/MFCustomButton+ActionModel.swift index b967db48..d008a7fb 100644 --- a/MVMCoreUI/Atoms/Buttons/MFCustomButton+ActionModel.swift +++ b/MVMCoreUI/Atoms/Buttons/MFCustomButton+ActionModel.swift @@ -9,7 +9,7 @@ import Foundation public extension MFCustomButton { - func set(with action: ActionProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { + func set(with action: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) { buttonDelegate = delegateObject?.buttonDelegate add({ [weak self] sender in guard let self = self else { return } diff --git a/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift b/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift index 8dd5c562..2ebcb4b4 100644 --- a/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift +++ b/MVMCoreUI/Atoms/Views/Label/LabelAttributeActionModel.swift @@ -12,7 +12,7 @@ class LabelAttributeActionModel: LabelAttributeModel { override public class var identifier: String { return "action" } - var action: ActionProtocol + var action: ActionModelProtocol required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) diff --git a/MVMCoreUI/Atoms/Views/ToggleModel.swift b/MVMCoreUI/Atoms/Views/ToggleModel.swift index 12706a49..75fddd28 100644 --- a/MVMCoreUI/Atoms/Views/ToggleModel.swift +++ b/MVMCoreUI/Atoms/Views/ToggleModel.swift @@ -13,7 +13,7 @@ public class ToggleModel: MoleculeModelProtocol { public var moleculeName: String? public var backgroundColor: Color? public var state: Bool = true - public var action: ActionProtocol? + public var action: ActionModelProtocol? public var required: Bool? public var fieldKey: String? diff --git a/MVMCoreUI/Models/ModelProtocols/ListItemModelProtocol.swift b/MVMCoreUI/Models/ModelProtocols/ListItemModelProtocol.swift index 857bd060..9d424a2b 100644 --- a/MVMCoreUI/Models/ModelProtocols/ListItemModelProtocol.swift +++ b/MVMCoreUI/Models/ModelProtocols/ListItemModelProtocol.swift @@ -10,14 +10,14 @@ import Foundation public protocol ListItemModelProtocol: ContainerModelProtocol, MoleculeModelProtocol { var line: LineModel? { get set } - var action: ActionProtocol? { get set } + var action: ActionModelProtocol? { get set } var hideArrow: Bool? { get set } var style: String? { get set } } // Not a strict requirement. extension ListItemModelProtocol { - public var action: ActionProtocol? { + public var action: ActionModelProtocol? { get { return nil } diff --git a/MVMCoreUI/Molecules/Items/ListItemModel.swift b/MVMCoreUI/Molecules/Items/ListItemModel.swift index 97fef586..5356ce25 100644 --- a/MVMCoreUI/Molecules/Items/ListItemModel.swift +++ b/MVMCoreUI/Molecules/Items/ListItemModel.swift @@ -12,7 +12,7 @@ import MVMCore @objcMembers public class ListItemModel: MoleculeContainerModel, ListItemModelProtocol { public static var identifier: String = "listItem" public var backgroundColor: Color? - public var action: ActionProtocol? + public var action: ActionModelProtocol? public var hideArrow: Bool? public var line: LineModel? public var style: String? = "standard"