updated samples

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-09-08 16:52:43 -05:00
parent 97529455a3
commit c99fbd0656
2 changed files with 14 additions and 0 deletions

View File

@ -95,6 +95,14 @@ class CheckboxGroupViewController: ModelScrollViewController<DefaultCheckboxGro
self?.model = viewModel
}.store(in: &subscribers)
checkboxGroup
.publisher(for: .valueChanged)
.sink { group in
group.model.selectors.forEach { checkbox in
print("\(checkbox.labelText!) selected: \(checkbox.selected)")
}
}.store(in: &subscribers)
//setup UI
surfacePickerSelectorView.text = model.surface.rawValue
disabledSwitch.isOn = model.disabled

View File

@ -100,6 +100,12 @@ class CheckboxViewController: ModelScrollViewController<DefaultCheckboxModel> {
self?.model = viewModel
}.store(in: &subscribers)
checkbox
.publisher(for: .valueChanged)
.sink { checkbox in
print("checkbox selected: \(checkbox.model.selected)")
}.store(in: &subscribers)
//setup UI
surfacePickerSelectorView.text = model.surface.rawValue
disabledSwitch.isOn = model.selected