From db8ba6389249b004abd4c0311c20809eba8acf24 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 22 Aug 2024 13:12:00 -0500 Subject: [PATCH] added isEqual to Toggle Signed-off-by: Matt Bruce --- .../Atomic/Atoms/Selectors/ToggleModel.swift | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift b/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift index 7f937168..c2a4c467 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/ToggleModel.swift @@ -111,4 +111,31 @@ public class ToggleModel: FormFieldModel { try container.encode(textWeight, forKey: .textWeight) try container.encode(textPosition, forKey: .textPosition) } + + open override func isEqual(to model: any ModelComparisonProtocol) -> Bool { + guard super.isEqual(to: model), let model = model as? Self else { return false } + return selected == model.selected + && animated == model.animated + && action.isEqual(to: model.action) + && alternateAction.isEqual(to: model.alternateAction) + && accessibilityText == model.accessibilityText + && showText == model.showText + && onText == model.onText + && offText == model.offText + && textSize == model.textSize + && textWeight == model.textWeight + && textPosition == model.textPosition + } + + open override func isVisuallyEquivalent(to model: any MoleculeModelComparisonProtocol) -> Bool { + guard super.isVisuallyEquivalent(to: model), let model = model as? Self else { return false } + return selected == model.selected + && animated == model.animated + && accessibilityText == model.accessibilityText + && showText == model.showText + && onText == model.onText + && offText == model.offText + && textSize == model.textSize + && textWeight == model.textWeight + && textPosition == model.textPosition } }