[+] Allow AlarmActivator to segue to the alarm activating view

This commit is contained in:
Hykilpikonna
2021-01-17 15:13:11 -05:00
parent f88c48b9ad
commit d90c792436
3 changed files with 33 additions and 12 deletions
+11 -3
View File
@@ -6,20 +6,26 @@
//
import Foundation
import UIKit
/**
Class to activate alarms when the user is inside the app
Note: This will not run when app is switched to the background or when the display is turned off, but it will run right after the user switched back to the app.
*/
class AlarmActivator
class AlarmActivator: UITabBarController
{
/// Interval in seconds
static var interval = 1.0
static var interval = 2.0
/// Timer for scheduled calls
var timer: Timer?
override func viewDidLoad()
{
start()
}
/**
Start detecting alarms
*/
@@ -43,9 +49,11 @@ class AlarmActivator
*/
@objc func check()
{
NSLog("Check")
// Get the alarm to activate
guard let alarm = Alarms.fromLocal().listActivating.first else { return }
NSLog(JSON.stringify(alarm)!)
performSegue(withIdentifier: "activate-alarmactivate-alarm", sender: nil)
}
}