removed accessibility settings to use VDS and rearranged

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-30 08:09:44 -05:00
parent c7d5cac1af
commit 62a74e8c34

View File

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