[+] Allow AlarmActivator to segue to the alarm activating view
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user