mobile-ios/CovidSafe/OnboardingStep2cViewController.swift

45 lines
1.5 KiB
Swift
Raw Normal View History

2020-05-08 07:49:14 +00:00
//
// OnboardingStep2cViewController.swift
// CovidSafe
//
// Copyright © 2020 Australian Government. All rights reserved.
//
import UIKit
class OnboardingStep2cViewController: UIViewController {
@IBAction func enabledBluetoothBtn(_ sender: UIButton) {
UserDefaults.standard.set(true, forKey: "turnedOnBluetooth")
DispatchQueue.main.async {
UNUserNotificationCenter.current().getNotificationSettings(completionHandler: { [weak self] settings in
DispatchQueue.main.async {
if settings.authorizationStatus == .authorized && BluetraceManager.shared.isBluetoothAuthorized() && BluetraceManager.shared.isBluetoothOn() {
self?.performSegue(withIdentifier: "showFullySetUpFromTurnOnBtSegue", sender: self)
} else {
self?.performSegue(withIdentifier: "showHomeFromTurnOnBtSegue", sender: self)
}
}
})
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}