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) {} + }