From 650c48ade9959760dec31ef33a1caf4a5fd90968 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 17 Jan 2021 13:26:47 -0500 Subject: [PATCH] [U] Update alarm instantiation --- ProjectClock/AppDelegate.swift | 2 +- ProjectClock/TestingViewController.swift | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ProjectClock/AppDelegate.swift b/ProjectClock/AppDelegate.swift index 0765774..94fb720 100644 --- a/ProjectClock/AppDelegate.swift +++ b/ProjectClock/AppDelegate.swift @@ -17,7 +17,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Init default settings localStorage.register(defaults: [ - "alarms": JSON.stringify([Alarm(alarmTime: Date(), text: "Wake up lol", wakeMethod: wvms[0])])! + "alarms": JSON.stringify([Alarm(enabled: true, alarmTime: Date(), text: "Wake up lol", wakeMethod: wvms[0])])! ]) // Start alarm activator diff --git a/ProjectClock/TestingViewController.swift b/ProjectClock/TestingViewController.swift index f0654a5..d787ac4 100644 --- a/ProjectClock/TestingViewController.swift +++ b/ProjectClock/TestingViewController.swift @@ -31,7 +31,7 @@ class TestingViewController: UIViewController { //Sends a test notification @IBAction func sendNotification(_ sender: Any) { - let alarm = Alarm(alarmTime: Date(), text: "Good morning!", wakeMethod: WVM(name: "walking", desc: "Walk")) + let alarm = Alarm(enabled: true, alarmTime: Date(), text: "Good morning!", wakeMethod: WVM(name: "walking", desc: "Walk")) let content = UNMutableNotificationContent() @@ -51,7 +51,6 @@ class TestingViewController: UIViewController { let attachment = try! UNNotificationAttachment(identifier: imageName, url: imageURL, options: .none) content.attachments = [attachment] - // Readies notification to be sent let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 10, repeats: false) let request = UNNotificationRequest(identifier: "notification.id.01", content: content, trigger: trigger)