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()
|
setupModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func setupForm() {
|
var actionLabel = Label()
|
||||||
|
override func setupForm(){
|
||||||
super.setupForm()
|
super.setupForm()
|
||||||
|
addFormRow(label: "Action", view: actionLabel)
|
||||||
addFormRow(label: "Disabled", view: disabledSwitch)
|
addFormRow(label: "Disabled", view: disabledSwitch)
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
addFormRow(label: "Strikethrough", view: strikeThroughSwitch)
|
addFormRow(label: "Strikethrough", view: strikeThroughSwitch)
|
||||||
@ -82,18 +84,11 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
|||||||
|
|
||||||
component.selectorModels = [radioBox1, radioBox2]
|
component.selectorModels = [radioBox1, radioBox2]
|
||||||
|
|
||||||
component
|
component.onChange = { [weak self] group in
|
||||||
.publisher(for: .valueChanged)
|
let newText = "Selected:\r\(group.selectedHandler?.text ?? "none")"
|
||||||
.sink { [weak self] group in
|
self?.actionLabel.text = newText
|
||||||
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)
|
|
||||||
|
|
||||||
//set UI values
|
//set UI values
|
||||||
surfacePickerSelectorView.text = component.surface.rawValue
|
surfacePickerSelectorView.text = component.surface.rawValue
|
||||||
disabledSwitch.isOn = component.disabled
|
disabledSwitch.isOn = component.disabled
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user