Made alarmTone editable, but localRead() nil error.

This commit is contained in:
Aaron
2021-01-27 22:44:16 -05:00
parent 240e23743b
commit 83d304e215
4 changed files with 24 additions and 3 deletions
+4 -1
View File
@@ -84,6 +84,7 @@ class Alarm: Codable, Equatable
var wakeMethod: WVM
var alarmTone: SystemSoundID
var notificationID: String
var toneName: String
/// What days does it repeat (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
var repeats: [Bool]
@@ -96,7 +97,8 @@ class Alarm: Codable, Equatable
hour: Int, minute: Int, text: String, wakeMethod: WVM,
repeats: [Bool] = [false, true, true, true, true, true, false],
lastActivate: Date = Date(),
alarmTone: SystemSoundID = ringtones[0].tone
alarmTone: SystemSoundID = ringtones[0].tone,
toneName: String = ""
)
{
@@ -109,6 +111,7 @@ class Alarm: Codable, Equatable
self.lastActivate = lastActivate
self.alarmTone = alarmTone
self.notificationID = "notification.id.\(Int.random(in: 1...Int.max))"
self.toneName = toneName
}
/// Does it automatically disable after activating once