diff --git a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift index defe6816..4b28fc8c 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretLinkModel.swift @@ -30,6 +30,7 @@ public class CaretLinkModel: ButtonModelProtocol, MoleculeModelProtocol { case enabledColor case disabledColor case enabled + case moleculeName } required public init(from decoder: Decoder) throws { @@ -50,6 +51,7 @@ public class CaretLinkModel: ButtonModelProtocol, MoleculeModelProtocol { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) try container.encode(title, forKey: .title) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encodeModel(action, forKey: .action) diff --git a/MVMCoreUI/Atoms/Buttons/LinkModel.swift b/MVMCoreUI/Atoms/Buttons/LinkModel.swift index f4fab34c..1092289f 100644 --- a/MVMCoreUI/Atoms/Buttons/LinkModel.swift +++ b/MVMCoreUI/Atoms/Buttons/LinkModel.swift @@ -29,6 +29,7 @@ public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol { case enabled case textColor case disabledColor + case moleculeName } required public init(from decoder: Decoder) throws { @@ -56,5 +57,6 @@ public class LinkModel: ButtonModelProtocol, MoleculeModelProtocol { try container.encode(enabled, forKey: .enabled) try container.encode(textColor, forKey: .textColor) try container.encode(disabledColor, forKey: .disabledColor) + try container.encode(moleculeName, forKey: .moleculeName) } } diff --git a/MVMCoreUI/Atoms/TextFields/EntryFieldModel.swift b/MVMCoreUI/Atoms/TextFields/EntryFieldModel.swift index 1030fb8c..e4a794bc 100644 --- a/MVMCoreUI/Atoms/TextFields/EntryFieldModel.swift +++ b/MVMCoreUI/Atoms/TextFields/EntryFieldModel.swift @@ -19,7 +19,6 @@ import Foundation } public var backgroundColor: Color? - public var moleculeName: String? public var title: String? public var feedback: String? public var errorMessage: String = "" @@ -54,7 +53,6 @@ import Foundation required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) title = try typeContainer.decodeIfPresent(String.self, forKey: .title) feedback = try typeContainer.decodeIfPresent(String.self, forKey: .feedback) diff --git a/MVMCoreUI/Atoms/Views/CircleProgressModel.swift b/MVMCoreUI/Atoms/Views/CircleProgressModel.swift index c4f55bef..9a1908f8 100644 --- a/MVMCoreUI/Atoms/Views/CircleProgressModel.swift +++ b/MVMCoreUI/Atoms/Views/CircleProgressModel.swift @@ -48,6 +48,7 @@ public class CircleProgressModel: MoleculeModelProtocol { case duration case colors case backgroundColor + case moleculeName } required public init(from decoder: Decoder) throws { @@ -78,6 +79,7 @@ public class CircleProgressModel: MoleculeModelProtocol { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) try container.encode(style, forKey: .style) try container.encode(size, forKey: .size) try container.encode(diameter, forKey: .diameter) diff --git a/MVMCoreUI/Atoms/Views/ToggleModel.swift b/MVMCoreUI/Atoms/Views/ToggleModel.swift index 9cd96f45..aafacec8 100644 --- a/MVMCoreUI/Atoms/Views/ToggleModel.swift +++ b/MVMCoreUI/Atoms/Views/ToggleModel.swift @@ -10,7 +10,6 @@ import UIKit public class ToggleModel: MoleculeModelProtocol { public static var identifier: String = "toggle" - public var moleculeName: String? public var backgroundColor: Color? public var state: Bool = true public var action: ActionModelProtocol? diff --git a/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift b/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift index f45c771d..8b69c590 100644 --- a/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift +++ b/MVMCoreUI/Molecules/HorizontalCombinationViews/TabsModel.swift @@ -22,6 +22,7 @@ public class TabsModel: MoleculeModelProtocol { case backgroundColor case selectedColor case selectedIndex + case moleculeName } public init(with tabs: [LabelModel]) { @@ -42,6 +43,7 @@ public class TabsModel: MoleculeModelProtocol { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(moleculeName, forKey: .moleculeName) try container.encode(tabs, forKey: .tabs) try container.encode(backgroundColor, forKey: .backgroundColor) try container.encode(selectedColor, forKey: .selectedColor) diff --git a/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift b/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift index f4b67216..bb3e6f17 100644 --- a/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift +++ b/MVMCoreUI/Molecules/LeftRightViews/CornerLabelsModel.swift @@ -28,6 +28,7 @@ public class CornerLabelsModel: MoleculeModelProtocol { case bottomLeftLabel case bottomRightLabel case molecule + case moleculeName } required public init(from decoder: Decoder) throws { @@ -48,5 +49,6 @@ public class CornerLabelsModel: MoleculeModelProtocol { try container.encodeIfPresent(topRightLabel, forKey: .topRightLabel) try container.encodeIfPresent(bottomLeftLabel, forKey: .bottomLeftLabel) try container.encodeIfPresent(bottomRightLabel, forKey: .bottomRightLabel) + try container.encode(moleculeName, forKey: .moleculeName) } } diff --git a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift index caa00021..c66f27b8 100644 --- a/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift +++ b/MVMCoreUI/Molecules/VerticalCombinationViews/Lists/StringAndMoleculeStack/StringAndMoleculeModel.swift @@ -38,5 +38,6 @@ public class StringAndMoleculeModel: MoleculeModelProtocol { try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(string, forKey: .string) try container.encodeModel(molecule, forKey: .molecule) + try container.encode(moleculeName, forKey: .moleculeName) } } diff --git a/MVMCoreUI/Organisms/CarouselModel.swift b/MVMCoreUI/Organisms/CarouselModel.swift index e43e6caa..79693135 100644 --- a/MVMCoreUI/Organisms/CarouselModel.swift +++ b/MVMCoreUI/Organisms/CarouselModel.swift @@ -53,7 +53,7 @@ import UIKit public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(moleculeName, forKey: .moleculeName) + try container.encode(moleculeName, forKey: .moleculeName) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) try container.encode(molecules, forKey: .molecules) try container.encode(spacing, forKey: .spacing) diff --git a/MVMCoreUI/Organisms/StackModel.swift b/MVMCoreUI/Organisms/StackModel.swift index 741946c5..8d670efb 100644 --- a/MVMCoreUI/Organisms/StackModel.swift +++ b/MVMCoreUI/Organisms/StackModel.swift @@ -45,5 +45,6 @@ import Foundation try container.encodeIfPresent(molecules, forKey: .molecules) try container.encodeIfPresent(axis.rawValueString, forKey: .axis) try container.encodeIfPresent(spacing, forKey: .spacing) + try container.encode(moleculeName, forKey: .moleculeName) } }