updated checkbox defaults

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-08-03 08:49:38 -05:00
parent b4f8d56024
commit 2df3c348b7
2 changed files with 23 additions and 1 deletions

View File

@ -456,7 +456,12 @@
</view>
<connections>
<outlet property="checkboxContainerView" destination="scQ-pX-VeB" id="iK2-ur-gRa"/>
<outlet property="childTextField" destination="The-la-7yI" id="ugF-kY-7FV"/>
<outlet property="disabledSwitch" destination="2Ko-LD-7KV" id="IiO-RV-xfb"/>
<outlet property="errorTextField" destination="bTZ-cJ-HFn" id="WzU-FZ-5IU"/>
<outlet property="labelTextField" destination="L04-kA-ok2" id="2e4-kr-mPd"/>
<outlet property="picker" destination="fgL-1d-z5o" id="odl-mn-oGC"/>
<outlet property="showErrorSwitch" destination="GEz-RV-j2l" id="eq7-Pb-JAK"/>
<outlet property="surfaceLabel" destination="QJe-b9-yOV" id="rkJ-CZ-ZdE"/>
</connections>
</viewController>

View File

@ -21,12 +21,29 @@ class CheckboxViewController: UIViewController, StoryboardInitable {
@IBOutlet weak var picker: UIPickerView!
@IBOutlet weak var surfaceLabel: UILabel!
@IBOutlet weak var disabledSwitch: UISwitch!
@IBOutlet weak var labelTextField: UITextField!
@IBOutlet weak var childTextField: UITextField!
@IBOutlet weak var showErrorSwitch: UISwitch!
@IBOutlet weak var errorTextField: UITextField!
var checkbox: VDSCheckbox!
override func viewDidLoad() {
super.viewDidLoad()
let model = DefaultCheckboxModel()
model.labelText = "Terms and conditions"
model.childText = "I agree to Verizon's terms and conditions"
model.errorText = "Error Text"
checkbox = VDSCheckbox()
surfaceLabel.text = model.surface.rawValue
disabledSwitch.isOn = model.on
labelTextField.text = model.labelText
childTextField.text = model.childText
showErrorSwitch.isOn = model.showError
errorTextField.text = model.errorText
checkbox = VDSCheckbox(with: model)
checkbox.translatesAutoresizingMaskIntoConstraints = false
checkboxContainerView.addSubview(checkbox)
checkbox.leadingAnchor.constraint(equalTo: checkboxContainerView.leadingAnchor, constant: 20).isActive = true