diff --git a/VDS/Components/RadioButton/RadioButton.swift b/VDS/Components/RadioButton/RadioButton.swift index a85c1e04..8348a9b7 100644 --- a/VDS/Components/RadioButton/RadioButton.swift +++ b/VDS/Components/RadioButton/RadioButton.swift @@ -57,9 +57,9 @@ open class RadioButtonBase: SelectorBase } }() - open override func toggleAndAction() { + open override func toggle() { guard !isSelected else { return } - super.toggleAndAction() + super.toggle() } //-------------------------------------------------- diff --git a/VDS/Components/Selector/SelectorBase.swift b/VDS/Components/Selector/SelectorBase.swift index 178ec74d..9aa1c8a5 100644 --- a/VDS/Components/Selector/SelectorBase.swift +++ b/VDS/Components/Selector/SelectorBase.swift @@ -226,7 +226,7 @@ open class SelectorBase: Control, Changable open override func sendActions(for controlEvents: UIControl.Event) { super.sendActions(for: controlEvents) if controlEvents.contains(.touchUpInside) { - toggleAndAction() + toggle() } } @@ -235,8 +235,8 @@ open class SelectorBase: Control, Changable } - /// This will checkbox the state of the Checkbox and execute the actionBlock if provided. - open func toggleAndAction() { + /// This will checkbox the state of the Selector and execute the actionBlock if provided. + open func toggle() { //removed error if hasError && isSelected == false { hasError.toggle() diff --git a/VDS/Components/Toggle/Toggle.swift b/VDS/Components/Toggle/Toggle.swift index 6106714a..384a2e4e 100644 --- a/VDS/Components/Toggle/Toggle.swift +++ b/VDS/Components/Toggle/Toggle.swift @@ -317,12 +317,12 @@ open class ToggleBase: Control, Changable { open override func sendActions(for controlEvents: UIControl.Event) { super.sendActions(for: controlEvents) if controlEvents.contains(.touchUpInside) { - toggleAndAction() + toggle() } } /// This will toggle the state of the Toggle and execute the actionBlock if provided. - public func toggleAndAction() { + open func toggle() { isOn.toggle() sendActions(for: .valueChanged) onChange?()