From 788b22610420c1276cd2325c7edb87ac029c5176 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 10 Aug 2022 16:06:07 -0500 Subject: [PATCH] Signed-off-by: Matt Bruce --- .../RadioButtonViewController.swift | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/VDSSample/ViewControllers/RadioButtonViewController.swift b/VDSSample/ViewControllers/RadioButtonViewController.swift index 0f04406..1b2d7ca 100644 --- a/VDSSample/ViewControllers/RadioButtonViewController.swift +++ b/VDSSample/ViewControllers/RadioButtonViewController.swift @@ -9,6 +9,7 @@ import Foundation import UIKit import VDS import VDSColorTokens +import Combine class RadioButtonViewController: UIViewController, StoryboardInitable { enum PickerType { @@ -30,9 +31,13 @@ class RadioButtonViewController: UIViewController, StoryboardInitable { // var radioButton: RadioButton! // var radioButton2: RadioButton! var radioButtonGroup = RadioButtonGroup() - + + public var model = RadioButtonGroupModel() + public var cancellables = Set() + override func viewDidLoad() { super.viewDidLoad() + var model1 = DefaultRadioButtonModel() model1.inputId = "model1" model1.labelText = "Terms and conditions" @@ -58,23 +63,9 @@ class RadioButtonViewController: UIViewController, StoryboardInitable { showErrorSwitch.isOn = model1.showError errorTextField.text = model1.errorText -// radioButton = RadioButton(with: model) -// radioButton.translatesAutoresizingMaskIntoConstraints = false -// -// radioButton2 = RadioButton(with: model2) -// radioButton2.translatesAutoresizingMaskIntoConstraints = false - -// let radioButtonController = RadioButtonController() -// radioButton.selectorController = radioButtonController -// radioButton2.selectorController = radioButtonController + model.selectors = [model1, model2] -// let stackView = UIStackView() -// stackView.translatesAutoresizingMaskIntoConstraints = false -// stackView.axis = .vertical -// stackView.spacing = 10 -// stackView.addArrangedSubview(radioButton) -// stackView.addArrangedSubview(radioButton2) - radioButtonGroup.set(with: RadioButtonGroupModel(selectors: [model1, model2])) + radioButtonGroup.set(with: model) componentContainerView.addSubview(radioButtonGroup) radioButtonGroup.leadingAnchor.constraint(equalTo: componentContainerView.leadingAnchor, constant: 10).isActive = true