From 2437c52faf88950acc2164b9fb2b5513a7509d7b Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 26 Jan 2021 15:55:49 -0500 Subject: [PATCH] Made Alarm Equatable (==) Ignores WVM --- ProjectClock/Models.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ProjectClock/Models.swift b/ProjectClock/Models.swift index 2705718..721788f 100644 --- a/ProjectClock/Models.swift +++ b/ProjectClock/Models.swift @@ -45,8 +45,14 @@ let wvms = [ //WVM(name: "Jump", desc: "Make a few jumps") ] -class Alarm: Codable +class Alarm: Codable, Equatable { + static func == (lhs: Alarm, rhs: Alarm) -> Bool { + return lhs.hour == rhs.hour && lhs.minute == rhs.minute && lhs.text == rhs.text && + lhs.alarmTone == rhs.alarmTone && lhs.notificationID == rhs.notificationID && + lhs.repeats == rhs.repeats + } + var enabled: Bool var hour: Int // Hour (24) var minute: Int