refactored

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-29 14:00:43 -05:00
parent 422695a427
commit 0f6787c32a
4 changed files with 6 additions and 11 deletions

View File

@ -59,7 +59,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
component.onChange = { [weak self] group in
guard let label = self?.actionLabel else { return }
let selected = group.selectedHandlers?
let selected = group.selectedItems?
.compactMap{"\($0.labelText!)"}
.joined(separator: "\r") ?? "none selected"
@ -104,7 +104,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
}
var checkbox: CheckboxItem? {
component.selectorViews.first
component.items.first
}
//Picker

View File

@ -17,7 +17,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
let firstButtonTextField = TextField()
let secondButtonTextField = TextField()
let hideCloseButtonToggle = Toggle()
let fullBleedToggle = Toggle()
let titleDefaultText = "This is title"
let subtitleDefaultText = "This is subtitle"
@ -59,7 +58,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
addFormRow(label: "SubTitle", view: subTitleTextField)
addFormRow(label: "Hide Button Group", view: buttonGroupToggle)
addFormRow(label: "Hide Close Button", view: hideCloseButtonToggle)
addFormRow(label: "Full bleed", view: fullBleedToggle)
addFormRow(label: "Action", view: label)
addFormRow(label: "First Button Text", view: firstButtonTextField)
addFormRow(label: "Second Button Text", view: secondButtonTextField)
@ -107,9 +105,6 @@ class NotificationViewController: BaseViewController<VDS.Notification> {
self?.component.hideCloseButton = toggle.isOn
}
fullBleedToggle.onChange = { [weak self] toggle in
self?.component.fullBleed = toggle.isOn
}
}
func setupPicker() {

View File

@ -84,7 +84,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
component.selectorModels = [radioBox1, radioBox2]
component.onChange = { [weak self] group in
let newText = "Selected:\r\(group.selectedHandler?.text ?? "none")"
let newText = "Selected:\r\(group.selectedItem?.text ?? "none")"
self?.actionLabel.text = newText
}
@ -97,7 +97,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
}
var radioBox: RadioBoxItem? {
component.selectorViews.first
component.items.first
}
//Picker

View File

@ -79,7 +79,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
component.selectorModels = [radioButton1, radioButton2, radioButton3]
component.onChange = { [weak self] group in
let newText = "Selected:\r\(group.selectedHandler?.labelText ?? "none")"
let newText = "Selected:\r\(group.selectedItem?.labelText ?? "none")"
self?.showErrorSwitch.isOn = group.showError
self?.actionLabel.text = newText
}
@ -93,7 +93,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
}
var radioButton: RadioButtonItem? {
component.selectorViews.first
component.items.first
}
//Picker