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 } }