refactored hasError to showError
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
5e1dbd1598
commit
6cd6685da4
@ -40,7 +40,7 @@ class CheckboxGroupViewController: ModelScrollViewController<DefaultCheckboxGro
|
|||||||
showErrorSwitch
|
showErrorSwitch
|
||||||
.publisher(for: .valueChanged)
|
.publisher(for: .valueChanged)
|
||||||
.sink { [weak self] sender in
|
.sink { [weak self] sender in
|
||||||
self?.checkboxGroup.hasError = sender.isOn
|
self?.checkboxGroup.showError = sender.isOn
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
disabledSwitch
|
disabledSwitch
|
||||||
@ -99,13 +99,13 @@ class CheckboxGroupViewController: ModelScrollViewController<DefaultCheckboxGro
|
|||||||
disabledSwitch.isOn = model.disabled
|
disabledSwitch.isOn = model.disabled
|
||||||
labelTextField.text = model2.labelText
|
labelTextField.text = model2.labelText
|
||||||
childTextField.text = model1.childText
|
childTextField.text = model1.childText
|
||||||
showErrorSwitch.isOn = model.hasError
|
showErrorSwitch.isOn = model.showError
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func updateView(viewModel: DefaultCheckboxGroupModel) {
|
override func updateView(viewModel: DefaultCheckboxGroupModel) {
|
||||||
print("\(Self.self) updateView(viewModel)")
|
print("\(Self.self) updateView(viewModel)")
|
||||||
showErrorSwitch.isOn = viewModel.hasError
|
showErrorSwitch.isOn = viewModel.showError
|
||||||
disabledSwitch.isOn = viewModel.disabled
|
disabledSwitch.isOn = viewModel.disabled
|
||||||
checkboxGroup.set(with: viewModel)
|
checkboxGroup.set(with: viewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class CheckboxViewController: ModelScrollViewController<DefaultCheckboxModel> {
|
|||||||
showErrorSwitch
|
showErrorSwitch
|
||||||
.publisher(for: .valueChanged)
|
.publisher(for: .valueChanged)
|
||||||
.sink { [weak self] sender in
|
.sink { [weak self] sender in
|
||||||
self?.checkbox.hasError = sender.isOn
|
self?.checkbox.showError = sender.isOn
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
disabledSwitch
|
disabledSwitch
|
||||||
@ -99,14 +99,14 @@ class CheckboxViewController: ModelScrollViewController<DefaultCheckboxModel> {
|
|||||||
disabledSwitch.isOn = model.selected
|
disabledSwitch.isOn = model.selected
|
||||||
labelTextField.text = model.labelText
|
labelTextField.text = model.labelText
|
||||||
childTextField.text = model.childText
|
childTextField.text = model.childText
|
||||||
showErrorSwitch.isOn = model.hasError
|
showErrorSwitch.isOn = model.showError
|
||||||
errorTextField.text = model.errorText
|
errorTextField.text = model.errorText
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func updateView(viewModel: DefaultCheckboxModel) {
|
override func updateView(viewModel: DefaultCheckboxModel) {
|
||||||
print("\(Self.self) updateView(viewModel)")
|
print("\(Self.self) updateView(viewModel)")
|
||||||
showErrorSwitch.isOn = viewModel.hasError
|
showErrorSwitch.isOn = viewModel.showError
|
||||||
disabledSwitch.isOn = viewModel.disabled
|
disabledSwitch.isOn = viewModel.disabled
|
||||||
checkbox.set(with: viewModel)
|
checkbox.set(with: viewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,7 +94,7 @@ class RadioBoxGroupViewController: ModelScrollViewController<DefaultRadioBoxGro
|
|||||||
.handlerPublisher()
|
.handlerPublisher()
|
||||||
.sink { [weak self] updatedModel in
|
.sink { [weak self] updatedModel in
|
||||||
self?.model = updatedModel
|
self?.model = updatedModel
|
||||||
self?.showErrorSwitch.isOn = updatedModel.hasError
|
self?.showErrorSwitch.isOn = updatedModel.showError
|
||||||
self?.disabledSwitch.isOn = updatedModel.disabled
|
self?.disabledSwitch.isOn = updatedModel.disabled
|
||||||
}
|
}
|
||||||
.store(in: &subscribers)
|
.store(in: &subscribers)
|
||||||
@ -115,7 +115,7 @@ class RadioBoxGroupViewController: ModelScrollViewController<DefaultRadioBoxGro
|
|||||||
|
|
||||||
override func updateView(viewModel: ModelType) {
|
override func updateView(viewModel: ModelType) {
|
||||||
print("\(Self.self) updateView(viewModel)")
|
print("\(Self.self) updateView(viewModel)")
|
||||||
showErrorSwitch.isOn = viewModel.hasError
|
showErrorSwitch.isOn = viewModel.showError
|
||||||
disabledSwitch.isOn = viewModel.disabled
|
disabledSwitch.isOn = viewModel.disabled
|
||||||
radioBoxGroup.set(with: viewModel)
|
radioBoxGroup.set(with: viewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class RadioButtonViewController: ModelScrollViewController<DefaultRadioButtonGr
|
|||||||
showErrorSwitch
|
showErrorSwitch
|
||||||
.publisher(for: .valueChanged)
|
.publisher(for: .valueChanged)
|
||||||
.sink { [weak self] sender in
|
.sink { [weak self] sender in
|
||||||
self?.radioButtonGroup.hasError = sender.isOn
|
self?.radioButtonGroup.showError = sender.isOn
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
disabledSwitch
|
disabledSwitch
|
||||||
@ -89,7 +89,7 @@ class RadioButtonViewController: ModelScrollViewController<DefaultRadioButtonGr
|
|||||||
.handlerPublisher()
|
.handlerPublisher()
|
||||||
.sink { [weak self] updatedModel in
|
.sink { [weak self] updatedModel in
|
||||||
self?.model = updatedModel
|
self?.model = updatedModel
|
||||||
self?.showErrorSwitch.isOn = updatedModel.hasError
|
self?.showErrorSwitch.isOn = updatedModel.showError
|
||||||
self?.disabledSwitch.isOn = updatedModel.disabled
|
self?.disabledSwitch.isOn = updatedModel.disabled
|
||||||
}
|
}
|
||||||
.store(in: &subscribers)
|
.store(in: &subscribers)
|
||||||
@ -103,14 +103,14 @@ class RadioButtonViewController: ModelScrollViewController<DefaultRadioButtonGr
|
|||||||
//set UI values
|
//set UI values
|
||||||
surfacePickerSelectorView.text = model.surface.rawValue
|
surfacePickerSelectorView.text = model.surface.rawValue
|
||||||
disabledSwitch.isOn = model.disabled
|
disabledSwitch.isOn = model.disabled
|
||||||
showErrorSwitch.isOn = model.hasError
|
showErrorSwitch.isOn = model.showError
|
||||||
labelTextField.text = model1.labelText
|
labelTextField.text = model1.labelText
|
||||||
childTextField.text = model1.childText
|
childTextField.text = model1.childText
|
||||||
}
|
}
|
||||||
|
|
||||||
override func updateView(viewModel: DefaultRadioButtonGroupModel) {
|
override func updateView(viewModel: DefaultRadioButtonGroupModel) {
|
||||||
print("\(Self.self) updateView(viewModel)")
|
print("\(Self.self) updateView(viewModel)")
|
||||||
showErrorSwitch.isOn = viewModel.hasError
|
showErrorSwitch.isOn = viewModel.showError
|
||||||
disabledSwitch.isOn = viewModel.disabled
|
disabledSwitch.isOn = viewModel.disabled
|
||||||
radioButtonGroup.set(with: viewModel)
|
radioButtonGroup.set(with: viewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user