updated methods and comments

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-07-30 08:22:24 -05:00
parent 73893d36d7
commit 8a89b2b2a9

View File

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