mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 04:55:19 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
54
CovidSafe/UnderSixteenViewController.swift
Normal file
54
CovidSafe/UnderSixteenViewController.swift
Normal file
|
@ -0,0 +1,54 @@
|
|||
//
|
||||
// IsolationSuccessViewController.swift
|
||||
// CovidSafe
|
||||
//
|
||||
// Created on 20/4/20.
|
||||
// Copyright © 2020 Australian Government. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
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.covidSafeButtonColor
|
||||
} 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()
|
||||
}
|
||||
|
||||
@IBAction func doneOntap(_ sender: Any) {
|
||||
performSegue(withIdentifier: "under16Consent", sender: nil)
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue