From e27fa862d5cae99dc38c89f4d9580da53900ecc0 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 24 Oct 2022 11:51:08 -0500 Subject: [PATCH] forgot to add back in animated to the model accessibilityIdentifier isn't even used in the current Toggle today Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift index 3fd6c3d5..fec5a78d 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift @@ -18,6 +18,7 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol { public var selected: Bool = false public var enabled: Bool = true public var readOnly: Bool = false + public var animated: Bool = false public var action: ActionModelProtocol? public var alternateAction: ActionModelProtocol? public var accessibilityText: String? @@ -34,8 +35,8 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol { case state case enabled case readOnly + case animated case action - case accessibilityIdentifier case alternateAction case accessibilityText case fieldKey @@ -87,13 +88,12 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol { } enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true readOnly = try typeContainer.decodeIfPresent(Bool.self, forKey: .readOnly) ?? false - + animated = try typeContainer.decodeIfPresent(Bool.self, forKey: .animated) ?? false } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) - try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier) try container.encodeModelIfPresent(action, forKey: .action) try container.encodeModelIfPresent(alternateAction, forKey: .alternateAction) try container.encode(moleculeName, forKey: .moleculeName) @@ -102,5 +102,6 @@ public class ToggleModel: MoleculeModelProtocol, FormFieldProtocol { try container.encodeIfPresent(fieldKey, forKey: .fieldKey) try container.encodeIfPresent(groupName, forKey: .groupName) try container.encode(readOnly, forKey: .readOnly) + try container.encode(animated, forKey: .animated) } }