|
|
@@ -7,6 +7,7 @@
|
|
|
//
|
|
|
|
|
|
import Foundation
|
|
|
+import UIKit
|
|
|
|
|
|
class UserDefaultsRepository {
|
|
|
|
|
|
@@ -25,6 +26,13 @@ class UserDefaultsRepository {
|
|
|
static let backgroundRefreshFrequency = UserDefaultsValue<Int>(key: "backgroundRefreshFrequency", default: 1)
|
|
|
static let backgroundRefresh = UserDefaultsValue<Bool>(key: "backgroundRefresh", default: true)
|
|
|
static let appBadge = UserDefaultsValue<Bool>(key: "appBadge", default: true)
|
|
|
+ static let dimScreenWhenIdle = UserDefaultsValue<Int>(key: "dimScreenWhenIdle", default: 0)
|
|
|
+ static let screenlockSwitchState = UserDefaultsValue<Bool>(
|
|
|
+ key: "screenlockSwitchState",
|
|
|
+ default: UIApplication.shared.isIdleTimerDisabled,
|
|
|
+ onChange: { screenlock in
|
|
|
+ UIApplication.shared.isIdleTimerDisabled = screenlock
|
|
|
+ })
|
|
|
|
|
|
// Alarm Settings
|
|
|
static let systemOutputVolume = UserDefaultsValue<Float>(key: "systemOutputVolume", default: 0.5)
|