diff --git a/VDSSample/ViewControllers/RadioBoxGroupViewController.swift b/VDSSample/ViewControllers/RadioBoxGroupViewController.swift index e0c6c2f..d72d09b 100644 --- a/VDSSample/ViewControllers/RadioBoxGroupViewController.swift +++ b/VDSSample/ViewControllers/RadioBoxGroupViewController.swift @@ -28,8 +28,10 @@ class RadioBoxGroupViewController: BaseViewController{ setupModel() } - override func setupForm() { + var actionLabel = Label() + override func setupForm(){ super.setupForm() + addFormRow(label: "Action", view: actionLabel) addFormRow(label: "Disabled", view: disabledSwitch) addFormRow(label: "Surface", view: surfacePickerSelectorView) addFormRow(label: "Strikethrough", view: strikeThroughSwitch) @@ -82,18 +84,11 @@ class RadioBoxGroupViewController: BaseViewController{ component.selectorModels = [radioBox1, radioBox2] - component - .publisher(for: .valueChanged) - .sink { [weak self] group in - let alertController:UIAlertController = UIAlertController(title: "Alert", - message: "Selected:\r\(group.selectedHandler?.text ?? "none")", - preferredStyle: UIAlertController.Style.alert) - alertController.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler:nil)) - self?.present(alertController, animated: true) - - print("Selected: \(group.selectedHandler?.text ?? "none")") - }.store(in: &subscribers) - + component.onChange = { [weak self] group in + let newText = "Selected:\r\(group.selectedHandler?.text ?? "none")" + self?.actionLabel.text = newText + } + //set UI values surfacePickerSelectorView.text = component.surface.rawValue disabledSwitch.isOn = component.disabled