updated radiobox for handler
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
2c708b512c
commit
93c0be4614
@ -28,8 +28,10 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
||||
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<RadioBoxGroup>{
|
||||
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user