From 26aa07f4b133fe06d6ccabe051abb1e715eece49 Mon Sep 17 00:00:00 2001 From: Aaron Date: Sun, 24 Jan 2021 17:47:49 -0500 Subject: [PATCH] Sends notif for DebugAlarm (Notifications are only sent when not in app) --- ProjectClock/DebugViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProjectClock/DebugViewController.swift b/ProjectClock/DebugViewController.swift index bd081e5..c4a989c 100644 --- a/ProjectClock/DebugViewController.swift +++ b/ProjectClock/DebugViewController.swift @@ -33,7 +33,10 @@ class DebugViewController: UIViewController @IBAction func addAlarm(_ sender: Any) { let (h, m, _) = Date().getHMS() - Alarms.fromLocal().apply { $0.list.append(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))) }.localSave() + 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)) + + Alarms.fromLocal().apply { $0.list.append(alarm) }.localSave() + Notification(alarm: alarm).scheduleNotification() } @IBAction func deleteAlarm(_ sender: Any)