From 8a89b2b2a917d9a34ff5396f1c5ac9a45fb94a0f Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 30 Jul 2024 08:22:24 -0500 Subject: [PATCH] updated methods and comments Signed-off-by: Matt Bruce --- .../Atomic/Atoms/Selectors/RadioBox.swift | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift index ce890bc3..73b23f93 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift @@ -7,7 +7,7 @@ // import VDS -open class RadioBox: VDS.RadioBoxItem, VDSMoleculeViewProtocol, MFButtonProtocol { +@objcMembers open class RadioBox: VDS.RadioBoxItem, VDSMoleculeViewProtocol, MFButtonProtocol { //------------------------------------------------------ // MARK: - Properties //------------------------------------------------------ @@ -15,14 +15,18 @@ open class RadioBox: VDS.RadioBoxItem, VDSMoleculeViewProtocol, MFButtonProtocol open var delegateObject: MVMCoreUIDelegateObject? open var additionalData: [AnyHashable : Any]? - public var isOutOfStock: Bool { viewModel.strikethrough } + open var isOutOfStock: Bool { + get { strikethrough } + set { + strikethrough = newValue + viewModel?.strikethrough = newValue + } + } //-------------------------------------------------- - // MARK: - MVMCoreViewProtocol + // MARK: - Lifecycle //-------------------------------------------------- - open func updateView(_ size: CGFloat) {} - open override func setup() { super.setup() @@ -48,14 +52,23 @@ open class RadioBox: VDS.RadioBoxItem, VDSMoleculeViewProtocol, MFButtonProtocol } } + //-------------------------------------------------- + // MARK: - Functions + //-------------------------------------------------- + @objc open func selectBox() { - guard isEnabled, !isSelected else { return } - isSelected = true - viewModel.selected = isSelected + toggle() } @objc open func deselectBox() { - + toggle() } + + //-------------------------------------------------- + // MARK: - MVMCoreViewProtocol + //-------------------------------------------------- + + open func updateView(_ size: CGFloat) {} + }