added notes for backgroundColor

added in ToggleBase property setters for ToggleModel properties

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-10-24 11:51:42 -05:00
parent e27fa862d5
commit 20fcbb57c2

View File

@ -78,12 +78,23 @@ open class Toggle: ToggleBase, VDSMoleculeViewProtocol {
open override func updateView() {
super.updateView()
//we want to overwrite the VDS color that is set in the ToggleBase
//for surface since the Atomic controls doesn't look at
//surface today for its views. We just want to show whatever
//the current parent's background color.
backgroundColor = .clear
}
open func viewModelDidUpdate() {
guard let viewModel else { return }
//set properties from the viewModel change that came in
if let accessibileString = viewModel.accessibilityText {
accessibilityLabelEnabled = accessibileString
accessibilityLabelDisabled = accessibileString
}
isAnimated = viewModel.animated
//send toggle.model to the Form
FormValidator.setupValidation(for: viewModel, delegate: delegateObject?.formHolderDelegate)
}