Fix up this so it actually sets the value

This commit is contained in:
ny
2024-10-11 01:48:01 -04:00
parent fc3ff41fc4
commit 0cb6da7be4
2 changed files with 8 additions and 3 deletions

View File

@@ -40,9 +40,9 @@ extension SettingsViewController
static var allCases: [AppRefreshRow] {
var c: [AppRefreshRow] = [.backgroundRefresh, .noIdleTimeout]
let low: OperatingSystemVersion = .init(majorVersion: 14, minorVersion: 0, patchVersion: 0)
let high: OperatingSystemVersion = .init(majorVersion: 18, minorVersion: 1, patchVersion: 0)
let high: OperatingSystemVersion = .init(majorVersion: 18, minorVersion: 2, patchVersion: 0)
let current = ProcessInfo.processInfo.operatingSystemVersion
if low <= current, current < high {
if UserDefaults.standard.isDebugModeEnabled, low <= current, current < high {
c.append(.disableAppLimit)
}
guard #available(iOS 14, *) else { return c }
@@ -328,6 +328,10 @@ private extension SettingsViewController
self.present(alertController, animated: true, completion: nil)
}
@IBAction func toggleDisableAppLimit(_ sender: UISwitch) {
UserDefaults.standard.isAppLimitDisabled = sender.isOn
}
@IBAction func toggleIsBackgroundRefreshEnabled(_ sender: UISwitch)
{
UserDefaults.standard.isBackgroundRefreshEnabled = sender.isOn