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!
|
@IBOutlet weak var errorTextField: UITextField!
|
||||||
|
|
||||||
var radioButton: RadioButton!
|
var radioButton: RadioButton!
|
||||||
|
var radioButton2: RadioButton!
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
@ -42,6 +43,10 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
|
|||||||
LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!)
|
LabelAttributeFont(location: 2, length: 5, style: .BoldTitleLarge, color: UIColor.red.hexString!)
|
||||||
]
|
]
|
||||||
model.errorText = "Error Text"
|
model.errorText = "Error Text"
|
||||||
|
|
||||||
|
var model2 = DefaultRadioButtonModel()
|
||||||
|
model2.childText = "Radio Sample 2"
|
||||||
|
|
||||||
|
|
||||||
surfaceLabel.text = model.surface.rawValue
|
surfaceLabel.text = model.surface.rawValue
|
||||||
disabledSwitch.isOn = model.selected
|
disabledSwitch.isOn = model.selected
|
||||||
@ -52,11 +57,28 @@ class RadioButtonViewController: UIViewController, StoryboardInitable {
|
|||||||
|
|
||||||
radioButton = RadioButton(with: model)
|
radioButton = RadioButton(with: model)
|
||||||
radioButton.translatesAutoresizingMaskIntoConstraints = false
|
radioButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
componentContainerView.addSubview(radioButton)
|
|
||||||
radioButton.leadingAnchor.constraint(equalTo: componentContainerView.leadingAnchor, constant: 10).isActive = true
|
radioButton2 = RadioButton(with: model2)
|
||||||
radioButton.bottomAnchor.constraint(equalTo: componentContainerView.bottomAnchor, constant: -20).isActive = true
|
radioButton2.translatesAutoresizingMaskIntoConstraints = false
|
||||||
radioButton.topAnchor.constraint(equalTo: componentContainerView.topAnchor, constant: 20).isActive = true
|
|
||||||
radioButton.trailingAnchor.constraint(equalTo: componentContainerView.trailingAnchor, constant: 10).isActive = true
|
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(_:))))
|
view.addGestureRecognizer(UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))))
|
||||||
setupPicker()
|
setupPicker()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user