From 305372fe0457bf049d4f4426ab7e84eaece2cbac Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 21 Jun 2022 15:10:59 -0500 Subject: [PATCH 1/7] added a public initializer Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Actions/ActionAlertModel.swift | 10 +++++++++- .../Atomic/Atoms/FormFields/Tags/TagModel.swift | 9 +++++++++ .../Atoms/FormFields/Tags/TagsModel.swift | 9 +++++++++ .../Atomic/Atoms/Selectors/HeartModel.swift | 7 ++++++- .../Atomic/Atoms/Selectors/RadioBoxModel.swift | 9 +++++++++ .../Atoms/Selectors/RadioBoxesModel.swift | 9 +++++++++ .../Atoms/Selectors/RadioSwatchModel.swift | 8 +++++++- .../Atoms/Selectors/RadioSwatchesModel.swift | 10 +++++++++- .../Atomic/Atoms/Views/CaretViewModel.swift | 8 +++++++- .../Atomic/Atoms/Views/CheckboxLabelModel.swift | 12 +++++++++++- .../Atomic/Atoms/Views/DashLineModel.swift | 8 +++++++- .../Atoms/Views/LoadingSpinnerModel.swift | 8 +++++++- MVMCoreUI/Atomic/Atoms/Views/StarModel.swift | 7 +++++++ MVMCoreUI/Atomic/Atoms/Views/StarsModel.swift | 9 +++++++++ MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift | 8 +++++++- ...reeColumnInternationalDataDividerModel.swift | 2 +- .../RadioButtonLabelModel.swift | 13 +++++++++++-- .../Items/AccordionListItemModel.swift | 9 +++++++++ .../ActionDetailWithImageModel.swift | 10 ++++++++++ .../HeadlineBodyButtonModel.swift | 12 +++++++++++- .../Lists/NumberedListModel.swift | 9 +++++++++ .../Lists/UnOrderedListModel.swift | 12 +++++++++++- .../ModalSectionListTemplateModel.swift | 10 +++++++++- .../Templates/ModalStackPageTemplateModel.swift | 10 +++++++++- .../Templates/SectionListTemplateModel.swift | 17 +++++++++++++++++ .../Rules/Rules/RuleAllValueChangedModel.swift | 8 ++++++++ .../Rules/Rules/RuleAnyRequiredModel.swift | 8 ++++++++ .../Rules/Rules/RuleAnyValueChangedModel.swift | 8 ++++++++ .../Rules/Rules/RuleEqualsIgnoreCaseModel.swift | 8 ++++++++ .../Rules/Rules/RuleEqualsModel.swift | 8 ++++++++ .../Rules/Rules/RuleRegexModel.swift | 9 +++++++++ .../Rules/Rules/RuleRequiredModel.swift | 8 ++++++++ 32 files changed, 276 insertions(+), 16 deletions(-) diff --git a/MVMCoreUI/Atomic/Actions/ActionAlertModel.swift b/MVMCoreUI/Atomic/Actions/ActionAlertModel.swift index cc6b3f60..67748a4d 100644 --- a/MVMCoreUI/Atomic/Actions/ActionAlertModel.swift +++ b/MVMCoreUI/Atomic/Actions/ActionAlertModel.swift @@ -5,7 +5,7 @@ // Created by Suresh, Kamlesh on 7/9/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore @objcMembers public class ActionAlertModel: ActionModelProtocol { //-------------------------------------------------- @@ -17,4 +17,12 @@ public var alert: AlertModel public var extraParameters: JSONValueDictionary? public var analyticsData: JSONValueDictionary? + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(alert: AlertModel) { + self.alert = alert + } } diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagModel.swift index 56a86742..823d2478 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagModel.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore @objcMembers public class TagModel: MoleculeModelProtocol { public static var identifier: String = "tag" @@ -27,6 +28,14 @@ import Foundation } } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(label: LabelModel) { + self.label = label + } + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) label = try typeContainer.decode(LabelModel.self, forKey: .label) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagsModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagsModel.swift index 009f8fa1..6330bb94 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagsModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/Tags/TagsModel.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore @objcMembers public class TagsModel: MoleculeModelProtocol { public static var identifier: String = "tags" @@ -19,6 +20,14 @@ import Foundation case tags } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with tags: [TagModel]) { + self.tags = tags + } + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) tags = try typeContainer.decode([TagModel].self, forKey: .tags) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/HeartModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/HeartModel.swift index c03a7302..4be1343a 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/HeartModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/HeartModel.swift @@ -5,7 +5,7 @@ // Created by Lekshmi S on 07/09/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore open class HeartModel: MoleculeModelProtocol, EnableableModelProtocol { @@ -38,6 +38,11 @@ open class HeartModel: MoleculeModelProtocol, EnableableModelProtocol { case readOnly } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public init() { } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxModel.swift index fc299b50..27defd48 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxModel.swift @@ -5,6 +5,7 @@ // Created by Dhamodaram Nandi on 31/03/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // +import MVMCore @objcMembers public class RadioBoxModel: MoleculeModelProtocol, EnableableModelProtocol { //-------------------------------------------------- @@ -43,6 +44,14 @@ case readOnly } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(text: String) { + self.text = text + } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxesModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxesModel.swift index 7e919553..852cd5c1 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxesModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxesModel.swift @@ -5,6 +5,7 @@ // Created by Dhamodaram Nandi on 31/03/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // +import MVMCore @objcMembers public class RadioBoxesModel: MoleculeModelProtocol, FormFieldProtocol { //-------------------------------------------------- @@ -52,6 +53,14 @@ case groupName } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with boxes: [RadioBoxModel]){ + self.boxes = boxes + } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchModel.swift index 059dd2c8..f0a194e9 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchModel.swift @@ -5,7 +5,7 @@ // Created by Scott Pfeil on 4/17/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore @objcMembers public class RadioSwatchModel: MoleculeModelProtocol, EnableableModelProtocol { //-------------------------------------------------- @@ -42,6 +42,12 @@ case readOnly } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchesModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchesModel.swift index 7e475081..21541d35 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchesModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioSwatchesModel.swift @@ -5,7 +5,7 @@ // Created by Lekshmi S on 31/03/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore @objcMembers public class RadioSwatchesModel: MoleculeModelProtocol, FormFieldProtocol { //-------------------------------------------------- @@ -50,6 +50,14 @@ case readOnly } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with swatches: [RadioSwatchModel]){ + self.swatches = swatches + } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/CaretViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CaretViewModel.swift index 9dc43286..1e2595ec 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CaretViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CaretViewModel.swift @@ -7,7 +7,7 @@ // import Foundation - +import MVMCore @objcMembers public class CaretViewModel: MoleculeModelProtocol { //-------------------------------------------------- @@ -38,6 +38,12 @@ import Foundation case inverted } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift index f3665eb0..239b5b1f 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore public enum CheckboxPosition: String, Codable { case center @@ -16,9 +17,18 @@ public enum CheckboxPosition: String, Codable { @objcMembers public class CheckboxLabelModel: MoleculeModelProtocol { public static var identifier: String = "checkboxLabel" - public var moleculeName: String public var backgroundColor: Color? public var checkboxAlignment: CheckboxPosition? public var checkbox: CheckboxModel public var label: LabelModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(checkbox: CheckboxModel, label: LabelModel) { + self.checkbox = checkbox + self.label = label + } + } diff --git a/MVMCoreUI/Atomic/Atoms/Views/DashLineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/DashLineModel.swift index c4375d53..95cc40fd 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/DashLineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/DashLineModel.swift @@ -7,7 +7,7 @@ // import Foundation - +import MVMCore @objcMembers public class DashLineModel: MoleculeModelProtocol { //-------------------------------------------------- @@ -43,6 +43,12 @@ import Foundation case isHidden } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + //-------------------------------------------------- // MARK: - codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift index bdef3c86..ddfba326 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift @@ -7,7 +7,7 @@ // import Foundation - +import MVMCore open class LoadingSpinnerModel: MoleculeModelProtocol { //-------------------------------------------------- @@ -32,6 +32,12 @@ open class LoadingSpinnerModel: MoleculeModelProtocol { case diameter } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/StarModel.swift b/MVMCoreUI/Atomic/Atoms/Views/StarModel.swift index dc404a71..56f4f7ad 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/StarModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/StarModel.swift @@ -5,6 +5,7 @@ // Created by Lekshmi S on 15/09/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // +import MVMCore open class StarModel: MoleculeModelProtocol { @@ -30,6 +31,12 @@ open class StarModel: MoleculeModelProtocol { case size } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/StarsModel.swift b/MVMCoreUI/Atomic/Atoms/Views/StarsModel.swift index 91470100..f79f638e 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/StarsModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/StarsModel.swift @@ -5,6 +5,7 @@ // Created by Lekshmi S on 21/09/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // +import MVMCore @objcMembers public class StarsModel: MoleculeModelProtocol { @@ -34,6 +35,14 @@ case size } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with stars: [StarModel]) { + self.stars = stars + } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift index 3e8d4340..d2d01d45 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift @@ -7,10 +7,10 @@ // import Foundation +import MVMCore @objcMembers public class WebViewModel: MoleculeModelProtocol { public static var identifier: String = "webview" - public var moleculeName: String = WebViewModel.identifier public var backgroundColor: Color? public var url: URL? public var htmlString: String? @@ -30,6 +30,12 @@ import Foundation case borderColor } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init() {} + required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift index f7df0c3a..7e402ca9 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/SectionDividers/ThreeColumn/ListThreeColumnInternationalDataDividerModel.swift @@ -23,7 +23,7 @@ public class ListThreeColumnInternationalDataDividerModel: ListItemModel, Molecu // MARK: - Initializers //------------------------------------------------------ - public init (leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { + public init(leftLabel: LabelModel, centerLabel: LabelModel, rightLabel: LabelModel) { self.leftLabel = leftLabel self.centerLabel = centerLabel self.rightLabel = rightLabel diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift index 014030ce..2a9dbd49 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift @@ -7,7 +7,7 @@ // import Foundation - +import MVMCore @objcMembers public class RadioButtonLabelModel: MoleculeModelProtocol { //-------------------------------------------------- @@ -16,7 +16,16 @@ import Foundation public static var identifier: String = "radioButtonLabel" public var backgroundColor: Color? - public var moleculeName: String public var radioButton: RadioButtonModel public var label: LabelModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(radioButton: RadioButtonModel, label: LabelModel) { + self.radioButton = radioButton + self.label = label + } + } diff --git a/MVMCoreUI/Atomic/Molecules/Items/AccordionListItemModel.swift b/MVMCoreUI/Atomic/Molecules/Items/AccordionListItemModel.swift index b4f39881..a864d1c2 100644 --- a/MVMCoreUI/Atomic/Molecules/Items/AccordionListItemModel.swift +++ b/MVMCoreUI/Atomic/Molecules/Items/AccordionListItemModel.swift @@ -42,6 +42,15 @@ class AccordionListItemModel: MoleculeListItemModel { hideArrow = true } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with moleculeModel: MoleculeModelProtocol, molecules:[ListItemModelProtocol & MoleculeModelProtocol]) { + self.molecules = molecules + super.init(with: moleculeModel) + } + //-------------------------------------------------- // MARK: - Codec //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImageModel.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImageModel.swift index 4cd2db26..7c8bd202 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImageModel.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ActionDetailWithImageModel.swift @@ -14,4 +14,14 @@ public class ActionDetailWithImageModel: MoleculeModelProtocol { public var backgroundColor: Color? public var headlineBodyButton: HeadlineBodyButtonModel public var image: ImageViewModel + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(headlineBodyButton: HeadlineBodyButtonModel, image: ImageViewModel) { + self.headlineBodyButton = headlineBodyButton + self.image = image + } + } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButtonModel.swift index cff8be23..70a08d3b 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyButtonModel.swift @@ -5,7 +5,7 @@ // Created by Scott Pfeil on 1/22/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore public class HeadlineBodyButtonModel: MoleculeModelProtocol { //-------------------------------------------------- @@ -20,6 +20,16 @@ public class HeadlineBodyButtonModel: MoleculeModelProtocol { public var button: ButtonModel public var buttonHeadlinePadding: CGFloat + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(headlineBody: HeadlineBodyModel, button: ButtonModel, buttonHeadlinePadding: CGFloat) { + self.headlineBody = headlineBody + self.button = button + self.buttonHeadlinePadding = buttonHeadlinePadding + } + //-------------------------------------------------- // MARK: - Method //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift index 874868e5..00098d91 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/NumberedListModel.swift @@ -20,6 +20,15 @@ import Foundation case list case numberColor } + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(numberColor: Color, molecules: [StackItemModelProtocol & MoleculeModelProtocol], axis: NSLayoutConstraint.Axis? = nil, spacing: CGFloat? = nil) { + self.numberColor = numberColor + super.init(molecules: molecules, axis: axis, spacing: spacing) + } // Numbered list model comes in the from of list = [MoleculeModelProtocol] public required init(from decoder: Decoder) throws { diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift index 9ba49c1a..3bff1575 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/Lists/UnOrderedListModel.swift @@ -22,7 +22,17 @@ import Foundation case bulletChar case bulletColor } - + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(bulletChar: String, bulletColor: Color, molecules: [StackItemModelProtocol & MoleculeModelProtocol], axis: NSLayoutConstraint.Axis? = nil, spacing: CGFloat? = nil) { + self.bulletChar = bulletChar + self.bulletColor = bulletColor + super.init(molecules: molecules, axis: axis, spacing: spacing) + } + // Numbered list model comes in the from of list = [MoleculeModelProtocol] public required init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) diff --git a/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift index d0f4d456..09f71914 100644 --- a/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift @@ -5,7 +5,7 @@ // Created by Scott Pfeil on 10/8/20. // Copyright © 2020 Verizon Wireless. All rights reserved. // - +import MVMCore @objcMembers public class ModalSectionListTemplateModel: SectionListTemplateModel { //-------------------------------------------------- @@ -15,6 +15,14 @@ public override class var identifier: String { "modalSectionList" } public var closeAction: ActionModelProtocol? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public override init(with sections: [SectionModel], pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol & MoleculeModelProtocol]) { + super.init(with: sections, pageType: pageType, screenHeading: screenHeading, molecules: molecules) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift index 3e8d2363..5cbb864a 100644 --- a/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalStackPageTemplateModel.swift @@ -15,6 +15,14 @@ public override class var identifier: String { "modalStack" } public var closeAction: ActionModelProtocol? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public override init(pageType: String, moleculeStack: StackModel) { + super.init(pageType: pageType, moleculeStack: moleculeStack) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- @@ -24,7 +32,7 @@ } //-------------------------------------------------- - // MARK: - Init + // MARK: - Initializer //-------------------------------------------------- required public init(from decoder: Decoder) throws { diff --git a/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift b/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift index 609e4cc0..7a6ec169 100644 --- a/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift @@ -19,6 +19,14 @@ public protocol SectionListHeaderFooterModel { } public var footer: (SectionListHeaderFooterModel & MoleculeModelProtocol)? public var rows: [ListItemModelProtocol & MoleculeModelProtocol] + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with rows: [ListItemModelProtocol & MoleculeModelProtocol]) { + self.rows = rows + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- @@ -65,6 +73,15 @@ public protocol SectionListHeaderFooterModel { } } } + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with sections: [SectionModel], pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol & MoleculeModelProtocol]) { + self.sections = sections + super.init(pageType: pageType, screenHeading: screenHeading, molecules: molecules) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAllValueChangedModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAllValueChangedModel.swift index 69b8599b..5b4f320f 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAllValueChangedModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAllValueChangedModel.swift @@ -19,6 +19,14 @@ public class RuleAllValueChangedModel: RulesProtocol { public var errorMessage: [String: String]? public var fields: [String] + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(with fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Validation //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyRequiredModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyRequiredModel.swift index 38dd6669..c8b7b055 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyRequiredModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyRequiredModel.swift @@ -19,6 +19,14 @@ public class RuleAnyRequiredModel: RuleAnyModelProtocol { public var fields: [String] public var errorMessage: [String: String]? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Methods //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyValueChangedModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyValueChangedModel.swift index 1d2c8faf..d52f59e2 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyValueChangedModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleAnyValueChangedModel.swift @@ -19,6 +19,14 @@ public class RuleAnyValueChangedModel: RuleAnyModelProtocol { public var errorMessage: [String: String]? public var fields: [String] + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Validation //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsIgnoreCaseModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsIgnoreCaseModel.swift index 4149737e..ab7f21b6 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsIgnoreCaseModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsIgnoreCaseModel.swift @@ -20,6 +20,14 @@ public class RuleEqualsIgnoreCaseModel: RuleCompareModelProtocol { public var fields: [String] public var errorMessage: [String: String]? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Validation //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsModel.swift index c8a8aa56..be7391ec 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleEqualsModel.swift @@ -19,6 +19,14 @@ public class RuleEqualsModel: RuleCompareModelProtocol { public var fields: [String] public var errorMessage: [String: String]? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Validation //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRegexModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRegexModel.swift index 48e4582b..e654210a 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRegexModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRegexModel.swift @@ -18,6 +18,15 @@ public class RuleRegexModel: RulesProtocol { public var regex: String public var errorMessage: [String: String]? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String], regex: String) { + self.fields = fields + self.regex = regex + } + //-------------------------------------------------- // MARK: - Properties //-------------------------------------------------- diff --git a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRequiredModel.swift b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRequiredModel.swift index f401721b..a0b51600 100644 --- a/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRequiredModel.swift +++ b/MVMCoreUI/FormUIHelpers/Rules/Rules/RuleRequiredModel.swift @@ -20,6 +20,14 @@ public class RuleRequiredModel: RulesProtocol { public var errorMessage: [String: String]? public var fields: [String] + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(fields: [String]) { + self.fields = fields + } + //-------------------------------------------------- // MARK: - Validation //-------------------------------------------------- From 33ad5a3630c832d69c29aea7e7d4e5e3c9935025 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 21 Jun 2022 15:11:42 -0500 Subject: [PATCH 2/7] added override intializer for subclasses Signed-off-by: Matt Bruce --- .../Atoms/FormFields/TextFields/TextEntryFieldModel.swift | 8 ++++++++ .../Atoms/Views/Label/LabelAttributeFontModel.swift | 8 ++++++++ .../Atoms/Views/Label/LabelAttributeImageModel.swift | 8 ++++++++ .../HeadersAndFooters/MoleculeSectionHeaderModel.swift | 7 +++++++ .../Atomic/Templates/ModalListPageTemplateModel.swift | 8 ++++++++ 5 files changed, 39 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift index 7c2dfa9b..7d2eb987 100644 --- a/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift +++ b/MVMCoreUI/Atomic/Atoms/FormFields/TextFields/TextEntryFieldModel.swift @@ -38,6 +38,14 @@ public var displayFormat: String? public var displayMask: String? + //-------------------------------------------------- + // MARK: - Initializers + //-------------------------------------------------- + + public override init(with text: String){ + super.init(with: text) + } + //-------------------------------------------------- // MARK: - Methods //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift index 72d57e40..6a2a1af5 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeFontModel.swift @@ -18,6 +18,14 @@ var name: String? var size: CGFloat? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public override init(_ location: Int, _ length: Int) { + super.init(location, length) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift index 12e8d68d..7396e749 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Label/LabelAttributeImageModel.swift @@ -18,6 +18,14 @@ class LabelAttributeImageModel: LabelAttributeModel { var name: String? var URL: String? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public override init(_ location: Int, _ length: Int) { + super.init(location, length) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/HeadersAndFooters/MoleculeSectionHeaderModel.swift b/MVMCoreUI/Atomic/Molecules/HeadersAndFooters/MoleculeSectionHeaderModel.swift index 47db5cbf..12201722 100644 --- a/MVMCoreUI/Atomic/Molecules/HeadersAndFooters/MoleculeSectionHeaderModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HeadersAndFooters/MoleculeSectionHeaderModel.swift @@ -14,6 +14,13 @@ public class override var identifier: String { "sectionHeader" } public var line: LineModel? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + public override init(with moleculeModel: MoleculeModelProtocol) { + super.init(with: moleculeModel) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift index 9459aab6..f1208274 100644 --- a/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalListPageTemplateModel.swift @@ -16,6 +16,14 @@ public var closeAction: ActionModelProtocol? + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public override init(pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol & MoleculeModelProtocol]) { + super.init(pageType: pageType, screenHeading: screenHeading, molecules: molecules) + } + //-------------------------------------------------- // MARK: - Keys //-------------------------------------------------- From d90503e9886cc9f1334cb3612c10bc428d4ce41f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 21 Jun 2022 15:12:53 -0500 Subject: [PATCH 3/7] added 'public' to current initializers Signed-off-by: Matt Bruce --- .../Atoms/Views/Video/VisibleBehaviorForVideoModel.swift | 2 +- .../Molecules/LeftRightViews/CornerLabelsModel.swift | 3 ++- .../LeftRightViews/ToggleMolecules/LabelToggleModel.swift | 3 ++- .../BGImageHeadlineBodyButtonModel.swift | 2 +- .../HeadlineBodyCaretLinkImageModel.swift | 2 +- MVMCoreUI/Containers/Views/Container.swift | 2 +- .../FormFieldEffect/ClearFormFieldEffectModel.swift | 6 +++++- .../FormFieldEffect/DisableFormFieldEffectModel.swift | 8 ++++++-- .../FormFieldEffect/DynamicRuleFormFieldEffectModel.swift | 6 +++++- .../FormFieldEffect/EnableFormFieldEffectModel.swift | 6 +++++- .../FormFieldEffect/HideFormFieldEffectModel.swift | 8 ++++++-- 11 files changed, 35 insertions(+), 13 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Video/VisibleBehaviorForVideoModel.swift b/MVMCoreUI/Atomic/Atoms/Views/Video/VisibleBehaviorForVideoModel.swift index 45734dac..44137b96 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Video/VisibleBehaviorForVideoModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Video/VisibleBehaviorForVideoModel.swift @@ -14,7 +14,7 @@ open class VisibleBehaviorForVideoModel: PageBehaviorModelProtocol { public var shouldAllowMultipleInstances: Bool = true public weak var videoModel: VideoModel? - init(with videoModel: VideoModel) { + public init(with videoModel: VideoModel) { self.videoModel = videoModel } } diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabelsModel.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabelsModel.swift index 5c910298..aabd29e7 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabelsModel.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/CornerLabelsModel.swift @@ -7,6 +7,7 @@ // import UIKit +import MVMCore public class CornerLabelsModel: ParentMoleculeModelProtocol { public static var identifier: String = "cornerLabels" @@ -20,7 +21,7 @@ public class CornerLabelsModel: ParentMoleculeModelProtocol { [molecule, topLeftLabel, topRightLabel, bottomLeftLabel, bottomRightLabel].compactMap { $0 } } - init(with molecule: MoleculeModelProtocol?) { + public init(with molecule: MoleculeModelProtocol?) { self.molecule = molecule } diff --git a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggleModel.swift b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggleModel.swift index 29e7a609..ee0c5f78 100644 --- a/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggleModel.swift +++ b/MVMCoreUI/Atomic/Molecules/LeftRightViews/ToggleMolecules/LabelToggleModel.swift @@ -7,6 +7,7 @@ // import Foundation +import MVMCore public class LabelToggleModel: MoleculeModelProtocol { public static var identifier: String = "labelToggle" @@ -15,7 +16,7 @@ public class LabelToggleModel: MoleculeModelProtocol { public var label: LabelModel public var toggle: ToggleModel - init(_ label: LabelModel, _ toggle: ToggleModel) { + public init(_ label: LabelModel, _ toggle: ToggleModel) { self.label = label self.toggle = toggle } diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift index 7c4215c2..99ee1567 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/BGImageHeadlineBodyButtonModel.swift @@ -22,7 +22,7 @@ public class BGImageHeadlineBodyButtonModel: ContainerModel, MoleculeModelProtoc // MARK: - Initializer //-------------------------------------------------- - init(headlineBody: HeadlineBodyModel, image: ImageViewModel) { + public init(headlineBody: HeadlineBodyModel, image: ImageViewModel) { self.headlineBody = headlineBody self.image = image super.init() diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyCaretLinkImageModel.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyCaretLinkImageModel.swift index 2a3d844a..5d7752fe 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyCaretLinkImageModel.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/HeadlineBodyCaretLinkImageModel.swift @@ -22,7 +22,7 @@ public class HeadlineBodyCaretLinkImageModel: ContainerModel, MoleculeModelProto // MARK: - Initializer //-------------------------------------------------- - init(headlineBody: HeadlineBodyModel, image: ImageViewModel) { + public init(headlineBody: HeadlineBodyModel, image: ImageViewModel) { self.headlineBody = headlineBody self.image = image super.init() diff --git a/MVMCoreUI/Containers/Views/Container.swift b/MVMCoreUI/Containers/Views/Container.swift index 5b2e83eb..32c22b54 100644 --- a/MVMCoreUI/Containers/Views/Container.swift +++ b/MVMCoreUI/Containers/Views/Container.swift @@ -75,7 +75,7 @@ open class Container: View, ContainerProtocol { self.view = view } - convenience init(andContain view: UIView) { + public convenience init(andContain view: UIView) { self.init() addAndContain(view) } diff --git a/MVMCoreUI/FormUIHelpers/FormFieldEffect/ClearFormFieldEffectModel.swift b/MVMCoreUI/FormUIHelpers/FormFieldEffect/ClearFormFieldEffectModel.swift index 173c0e33..32a18c6b 100644 --- a/MVMCoreUI/FormUIHelpers/FormFieldEffect/ClearFormFieldEffectModel.swift +++ b/MVMCoreUI/FormUIHelpers/FormFieldEffect/ClearFormFieldEffectModel.swift @@ -20,7 +20,11 @@ public class ClearFormFieldEffectModel: FormFieldEffectProtocol { public var activatedRuleIds: [String]? public var rules: [RulesProtocol] - init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { self.fieldKey = fieldKey self.activatedRuleIds = activatedRuleIds self.rules = rules diff --git a/MVMCoreUI/FormUIHelpers/FormFieldEffect/DisableFormFieldEffectModel.swift b/MVMCoreUI/FormUIHelpers/FormFieldEffect/DisableFormFieldEffectModel.swift index 09fbb6e3..ea0a718e 100644 --- a/MVMCoreUI/FormUIHelpers/FormFieldEffect/DisableFormFieldEffectModel.swift +++ b/MVMCoreUI/FormUIHelpers/FormFieldEffect/DisableFormFieldEffectModel.swift @@ -18,8 +18,12 @@ public class DisableFormFieldEffectModel: FormFieldEffectProtocol { public var fieldKey: String = "" public var activatedRuleIds: [String]? public var rules: [RulesProtocol] - - init(_ fieldKey: String, _ activatedRuleIds: [String], _ rules: [RulesProtocol]) { + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ fieldKey: String, _ activatedRuleIds: [String], _ rules: [RulesProtocol]) { self.fieldKey = fieldKey self.activatedRuleIds = activatedRuleIds self.rules = rules diff --git a/MVMCoreUI/FormUIHelpers/FormFieldEffect/DynamicRuleFormFieldEffectModel.swift b/MVMCoreUI/FormUIHelpers/FormFieldEffect/DynamicRuleFormFieldEffectModel.swift index 3a94f94b..38bfc79c 100644 --- a/MVMCoreUI/FormUIHelpers/FormFieldEffect/DynamicRuleFormFieldEffectModel.swift +++ b/MVMCoreUI/FormUIHelpers/FormFieldEffect/DynamicRuleFormFieldEffectModel.swift @@ -19,7 +19,11 @@ public class DynamicRuleFormFieldEffectModel: FormFieldEffectProtocol { public var activatedRuleIds: [String]? public var rules: [RulesProtocol] - init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { self.fieldKey = fieldKey self.activatedRuleIds = activatedRuleIds self.rules = rules diff --git a/MVMCoreUI/FormUIHelpers/FormFieldEffect/EnableFormFieldEffectModel.swift b/MVMCoreUI/FormUIHelpers/FormFieldEffect/EnableFormFieldEffectModel.swift index f4537bb6..271e57ea 100644 --- a/MVMCoreUI/FormUIHelpers/FormFieldEffect/EnableFormFieldEffectModel.swift +++ b/MVMCoreUI/FormUIHelpers/FormFieldEffect/EnableFormFieldEffectModel.swift @@ -21,7 +21,11 @@ public class EnableFormFieldEffectModel: FormFieldEffectProtocol { public var activatedRuleIds: [String]? public var rules: [RulesProtocol] - init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ fieldKey: String, activatedRuleIds: [String], rules: [RulesProtocol]) { self.fieldKey = fieldKey self.activatedRuleIds = activatedRuleIds self.rules = rules diff --git a/MVMCoreUI/FormUIHelpers/FormFieldEffect/HideFormFieldEffectModel.swift b/MVMCoreUI/FormUIHelpers/FormFieldEffect/HideFormFieldEffectModel.swift index 451dbe83..37929e12 100644 --- a/MVMCoreUI/FormUIHelpers/FormFieldEffect/HideFormFieldEffectModel.swift +++ b/MVMCoreUI/FormUIHelpers/FormFieldEffect/HideFormFieldEffectModel.swift @@ -18,8 +18,12 @@ public class HideFormFieldEffectModel: FormFieldEffectProtocol { public var fieldKey: String = "" public var activatedRuleIds: [String]? public var rules: [RulesProtocol] - - init(_ fieldKey: String, _ activatedRuleIds: [String], _ rules: [RulesProtocol]) { + + //-------------------------------------------------- + // MARK: - Initializer + //-------------------------------------------------- + + public init(_ fieldKey: String, _ activatedRuleIds: [String], _ rules: [RulesProtocol]) { self.fieldKey = fieldKey self.activatedRuleIds = activatedRuleIds self.rules = rules From 93d23d620d3388015d0c857dfc65c9cbad634894 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 21 Jun 2022 15:47:14 -0500 Subject: [PATCH 4/7] added default value Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift b/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift index 7a6ec169..023acae5 100644 --- a/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/SectionListTemplateModel.swift @@ -77,7 +77,7 @@ public protocol SectionListHeaderFooterModel { } // MARK: - Initializer //-------------------------------------------------- - public init(with sections: [SectionModel], pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol & MoleculeModelProtocol]) { + public init(with sections: [SectionModel], pageType: String, molecules: [ListItemModelProtocol & MoleculeModelProtocol], screenHeading: String? = nil) { self.sections = sections super.init(pageType: pageType, screenHeading: screenHeading, molecules: molecules) } From 5efd98b5b71557e53569ab774518972518a70bd4 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 22 Jun 2022 09:31:56 -0500 Subject: [PATCH 5/7] fixed variable order bug Signed-off-by: Matt Bruce --- .../Atomic/Templates/ModalSectionListTemplateModel.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift b/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift index 09f71914..582ce0ed 100644 --- a/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift +++ b/MVMCoreUI/Atomic/Templates/ModalSectionListTemplateModel.swift @@ -19,8 +19,8 @@ import MVMCore // MARK: - Initializer //-------------------------------------------------- - public override init(with sections: [SectionModel], pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol & MoleculeModelProtocol]) { - super.init(with: sections, pageType: pageType, screenHeading: screenHeading, molecules: molecules) + public override init(with sections: [SectionModel], pageType: String, molecules: [ListItemModelProtocol & MoleculeModelProtocol], screenHeading: String?) { + super.init(with: sections, pageType: pageType, molecules: molecules, screenHeading: screenHeading) } //-------------------------------------------------- From 63184f3c609d33c0a0c5ebcb844ff5a9074ae3c0 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 24 Jun 2022 10:19:09 -0500 Subject: [PATCH 6/7] added property back for the Swift Default Encoding issue with Extensions Signed-off-by: Matt Bruce --- .../HorizontalCombinationViews/RadioButtonLabelModel.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift index 2a9dbd49..69bca3fc 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/RadioButtonLabelModel.swift @@ -16,6 +16,7 @@ import MVMCore public static var identifier: String = "radioButtonLabel" public var backgroundColor: Color? + public var moleculeName: String = RadioButtonLabelModel.identifier public var radioButton: RadioButtonModel public var label: LabelModel From 60d3e2f47c24071cb5b053c1a832a12693e06624 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Fri, 24 Jun 2022 10:33:49 -0500 Subject: [PATCH 7/7] added back moleculeName for issue with Swift Default encoder Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift | 1 + MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift index 239b5b1f..858984b0 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CheckboxLabelModel.swift @@ -17,6 +17,7 @@ public enum CheckboxPosition: String, Codable { @objcMembers public class CheckboxLabelModel: MoleculeModelProtocol { public static var identifier: String = "checkboxLabel" + public var moleculeName: String = CheckboxLabelModel.identifier public var backgroundColor: Color? public var checkboxAlignment: CheckboxPosition? public var checkbox: CheckboxModel diff --git a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift index d2d01d45..4cb2bd55 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/WebViewModel.swift @@ -11,6 +11,7 @@ import MVMCore @objcMembers public class WebViewModel: MoleculeModelProtocol { public static var identifier: String = "webview" + public var moleculeName: String = WebViewModel.identifier public var backgroundColor: Color? public var url: URL? public var htmlString: String?