mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-19 21:15:21 +00:00
COVIDSafe code from version 1.1
This commit is contained in:
commit
3640e52eb2
330 changed files with 261540 additions and 0 deletions
56
CovidSafe/UploadDataVC.swift
Normal file
56
CovidSafe/UploadDataVC.swift
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue