COVIDSafe code from version 1.5 (#5)

This commit is contained in:
COVIDSafe Support 2020-06-05 10:26:40 +10:00 committed by GitHub
parent 6b262be150
commit 149daee2e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 825 additions and 652 deletions

View file

@ -11,42 +11,17 @@ import SafariServices
class UnderSixteenViewController: UIViewController, RegistrationHandler {
@IBOutlet weak var consentCheckBox: UIButton!
@IBOutlet weak var agreeButton: UIButton!
public var registrationInfo: RegistrationRequest?
override func viewDidLoad() {
super.viewDidLoad()
consentCheckBox.setImage(UIImage(named: "emptyCheckbox"), for: .normal)
consentCheckBox.setImage(UIImage(named: "selectedCheckbox"), for: .selected)
updateContinueButton()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if var vc = segue.destination as? RegistrationHandler {
vc.registrationInfo = self.registrationInfo
}
}
func updateContinueButton() {
if (agreeButton.isEnabled) {
agreeButton.backgroundColor = UIColor.covidSafeButtonDarkerColor
} else {
agreeButton.backgroundColor = UIColor(0xDBDDDD)
}
}
@IBAction func onBackTapped(_ sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
@IBAction func onCheckboxTapped(sender: UIButton) {
sender.isSelected = !sender.isSelected
self.agreeButton.isEnabled = sender.isSelected
updateContinueButton()
consentCheckBox.accessibilityLabel = sender.isSelected ? "I consent checkbox, checked" : "I consent checkbox, unchecked"
}
@IBAction func doneOntap(_ sender: Any) {
performSegue(withIdentifier: "under16Consent", sender: nil)