[+] Add wvm selector for adding debug alarms
This commit is contained in:
@@ -13,6 +13,9 @@ class DebugViewController: UIViewController
|
||||
@IBOutlet weak var userModeButton: UIButton!
|
||||
var darkMode = false
|
||||
|
||||
@IBOutlet weak var wvmInput: UITextField!
|
||||
@IBOutlet weak var wvmStepper: UIStepper!
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
@@ -36,7 +39,7 @@ class DebugViewController: UIViewController
|
||||
@IBAction func addAlarm(_ sender: Any)
|
||||
{
|
||||
let (h, m, _) = Date().getHMS()
|
||||
let alarm = Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[1], repeats: [true, true, true, true, true, true, true], lastActivate: Date().added(.minute, -1))
|
||||
let alarm = Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[Int(wvmStepper.value)], repeats: [true, true, true, true, true, true, true], lastActivate: Date().added(.minute, -1))
|
||||
|
||||
Alarms.fromLocal().apply { $0.list.append(alarm) }.localSave()
|
||||
Notification.scheduleNotification(alarm: alarm)
|
||||
@@ -47,6 +50,11 @@ class DebugViewController: UIViewController
|
||||
Alarms.fromLocal().apply { $0.list.removeAll() }.localSave()
|
||||
}
|
||||
|
||||
@IBAction func wvmStepperChange(_ sender: Any)
|
||||
{
|
||||
wvmInput.text = String(wvmStepper.value)
|
||||
}
|
||||
|
||||
@IBAction func switchViewingMode(_ sender: Any) {
|
||||
if !darkMode {
|
||||
view.window?.overrideUserInterfaceStyle = .dark
|
||||
|
||||
Reference in New Issue
Block a user