added 2nd button
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3b0a453aab
commit
efb3e23d6c
@ -28,6 +28,7 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
|
||||
@IBOutlet weak var errorTextField: UITextField!
|
||||
|
||||
var radioButton: RadioButton!
|
||||
var radioButton2: RadioButton!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
@ -42,6 +43,10 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
|
||||
LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!)
|
||||
]
|
||||
model.errorText = "Error Text"
|
||||
|
||||
var model2 = DefaultRadioButtonModel()
|
||||
model2.childText = "Radio Sample 2"
|
||||
|
||||
|
||||
surfaceLabel.text = model.surface.rawValue
|
||||
disabledSwitch.isOn = model.selected
|
||||
@ -52,11 +57,28 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
|
||||
|
||||
radioButton = RadioButton(with: model)
|
||||
radioButton.translatesAutoresizingMaskIntoConstraints = false
|
||||
componentContainerView.addSubview(radioButton)
|
||||
radioButton.leadingAnchor.constraint(equalTo: componentContainerView.leadingAnchor, constant: 10).isActive = true
|
||||
radioButton.bottomAnchor.constraint(equalTo: componentContainerView.bottomAnchor, constant: -20).isActive = true
|
||||
radioButton.topAnchor.constraint(equalTo: componentContainerView.topAnchor, constant: 20).isActive = true
|
||||
radioButton.trailingAnchor.constraint(equalTo: componentContainerView.trailingAnchor, constant: 10).isActive = true
|
||||
|
||||
radioButton2 = RadioButton(with: model2)
|
||||
radioButton2.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
let radioButtonController = RadioButtonController()
|
||||
radioButton.selectorController = radioButtonController
|
||||
radioButton2.selectorController = radioButtonController
|
||||
|
||||
let stackView = UIStackView()
|
||||
stackView.translatesAutoresizingMaskIntoConstraints = false
|
||||
stackView.axis = .vertical
|
||||
stackView.spacing = 10
|
||||
stackView.addArrangedSubview(radioButton)
|
||||
stackView.addArrangedSubview(radioButton2)
|
||||
|
||||
componentContainerView.addSubview(stackView)
|
||||
|
||||
stackView.leadingAnchor.constraint(equalTo: componentContainerView.leadingAnchor, constant: 10).isActive = true
|
||||
stackView.topAnchor.constraint(equalTo: componentContainerView.topAnchor, constant: 20).isActive = true
|
||||
stackView.bottomAnchor.constraint(equalTo: componentContainerView.bottomAnchor, constant: -20).isActive = true
|
||||
stackView.trailingAnchor.constraint(equalTo: componentContainerView.trailingAnchor, constant: 10).isActive = true
|
||||
|
||||
view.addGestureRecognizer(UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))))
|
||||
setupPicker()
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user