COVIDSafe code from version 1.1

This commit is contained in:
covidsafe-support 2020-05-08 17:49:14 +10:00
commit 3640e52eb2
330 changed files with 261540 additions and 0 deletions

View file

@ -0,0 +1,56 @@
import UIKit
import CoreData
class UploadDataViewController: UIViewController {
// MARK: - Local
private var uploadStepsNavigationVC: UINavigationController?
var _preferredScreenEdgesDeferringSystemGestures: UIRectEdge = []
// MARK: - Delegates
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(enableDeferringSystemGestures(_:)), name: .enableDeferringSystemGestures, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(disableDeferringSystemGestures(_:)), name: .disableDeferringSystemGestures, object: nil)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Reset the Steps navigation vc whenever user re-enter this tab
uploadStepsNavigationVC?.popToRootViewController(animated: false)
}
override var preferredScreenEdgesDeferringSystemGestures: UIRectEdge {
return _preferredScreenEdgesDeferringSystemGestures
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
@objc
func enableDeferringSystemGestures(_ notification: Notification) {
if #available(iOS 11.0, *) {
_preferredScreenEdgesDeferringSystemGestures = .bottom
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
}
}
@objc
func disableDeferringSystemGestures(_ notification: Notification) {
if #available(iOS 11.0, *) {
_preferredScreenEdgesDeferringSystemGestures = []
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
}
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let vc = segue.destination as? UINavigationController {
uploadStepsNavigationVC = vc
}
}
}