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

@@ -21,7 +21,7 @@
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" white="1" alpha="0.25" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="separatorColor" white="1" alpha="0.25" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<label key="tableFooterView" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SideStore 1.0" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="bUR-rp-Nw2"> <label key="tableFooterView" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SideStore 1.0" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" id="bUR-rp-Nw2">
<rect key="frame" x="0.0" y="1272" width="375" height="25"/> <rect key="frame" x="0.0" y="1293" width="375" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="1" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="0.69999999999999996" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
@@ -288,6 +288,7 @@
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1aa-og-ZXD"> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1aa-og-ZXD">
<rect key="frame" x="296" y="10" width="51" height="31"/> <rect key="frame" x="296" y="10" width="51" height="31"/>
<connections> <connections>
<action selector="toggleDisableAppLimit:" destination="aMk-Xp-UL8" eventType="valueChanged" id="zYc-B2-JPg"/>
<action selector="toggleNoIdleTimeoutEnabled:" destination="aMk-Xp-UL8" eventType="valueChanged" id="2wu-cw-L7v"/> <action selector="toggleNoIdleTimeoutEnabled:" destination="aMk-Xp-UL8" eventType="valueChanged" id="2wu-cw-L7v"/>
</connections> </connections>
</switch> </switch>

View File

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