diff --git a/LeCountdown/AppDelegate.swift b/LeCountdown/AppDelegate.swift index 450eb09..0ade17d 100644 --- a/LeCountdown/AppDelegate.swift +++ b/LeCountdown/AppDelegate.swift @@ -32,6 +32,10 @@ class AppDelegate : NSObject, UIApplicationDelegate { Conductor.maestro.cleanup() + if Preferences.installDate == nil { + Preferences.installDate = Date() + } + return true } diff --git a/LeCountdown/Utils/Preferences.swift b/LeCountdown/Utils/Preferences.swift index 0c3c66c..63453bf 100644 --- a/LeCountdown/Utils/Preferences.swift +++ b/LeCountdown/Utils/Preferences.swift @@ -8,6 +8,7 @@ import Foundation enum PreferenceKey: String { + case installDate case countdowns case stopwatches case playConfirmationSound @@ -32,6 +33,7 @@ class Preferences { @UserDefault(PreferenceKey.playCancellationSound.rawValue, defaultValue: true) static var playCancellationSound: Bool @UserDefault(PreferenceKey.cloudKitSchemaInitialized.rawValue, defaultValue: false) static var cloudKitSchemaInitialized: Bool @UserDefault(PreferenceKey.defaultVolume.rawValue, defaultValue: 0.5) static var defaultVolume: Float + @UserDefault(PreferenceKey.installDate.rawValue, defaultValue: nil) static var installDate: Date? static var hideSilentModeAlerts: Bool { return UserDefaults.standard.bool(forKey: PreferenceKey.showSilentModeAlert.rawValue)