From 62a74e8c34156ff71222d726a693fe58c38c2acc Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 30 Jul 2024 08:09:44 -0500 Subject: [PATCH] removed accessibility settings to use VDS and rearranged Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift b/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift index 30bcd85a..c268158c 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/Toggle.swift @@ -109,22 +109,6 @@ public typealias ActionBlockConfirmation = () -> (Bool) //-------------------------------------------------- // MARK: - Lifecycle //-------------------------------------------------- - public func updateView(_ size: CGFloat) { } - - public override func setup() { - super.setup() - - bridge_accessibilityHintBlock = { [weak self] in - guard let self else { return nil } - return MVMCoreUIUtility.hardcodedString(withKey: isEnabled ? "AccToggleHint" : "AccDisabled") - } - - bridge_accessibilityValueBlock = { [weak self] in - guard let self else { return nil } - return isOn ? MVMCoreUIUtility.hardcodedString(withKey: "AccOn") : MVMCoreUIUtility.hardcodedString(withKey: "AccOff") - } - } - public override func reset() { super.reset() accessibilityLabel = MVMCoreUIUtility.hardcodedString(withKey: "Toggle_buttonlabel") @@ -132,21 +116,6 @@ public typealias ActionBlockConfirmation = () -> (Bool) shouldToggleAction = { return true } } - //-------------------------------------------------- - // MARK: - Actions - //-------------------------------------------------- - /// This will toggle the state of the Toggle and execute the actionBlock if provided. - public func toggleAndAction() { - toggle() - } - - open override func toggle() { - if let result = shouldToggleAction?(), result { - super.toggle() - } - } - - // MARK:- MoleculeViewProtocol public func viewModelDidUpdate() { FormValidator.setupValidation(for: viewModel, delegate: delegateObject?.formHolderDelegate) @@ -185,7 +154,27 @@ public typealias ActionBlockConfirmation = () -> (Bool) } } } + + //-------------------------------------------------- + // MARK: - Actions + //-------------------------------------------------- + /// This will toggle the state of the Toggle and execute the actionBlock if provided. + public func toggleAndAction() { + toggle() + } + open override func toggle() { + if let result = shouldToggleAction?(), result { + super.toggle() + } + } + + //-------------------------------------------------- + // MARK:- MoleculeViewProtocol + //-------------------------------------------------- + + public func updateView(_ size: CGFloat) {} + public class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { return Self().intrinsicContentSize.height }