diff --git a/LoopFollow/Extensions/EKEventStore+Extensions.swift b/LoopFollow/Extensions/EKEventStore+Extensions.swift index 2e8089dca..c9b81e2f2 100644 --- a/LoopFollow/Extensions/EKEventStore+Extensions.swift +++ b/LoopFollow/Extensions/EKEventStore+Extensions.swift @@ -4,26 +4,16 @@ import EventKit import Foundation -#if swift(>=5.9) - extension EKEventStore { - func requestCalendarAccess(completion: @escaping (Bool, Error?) -> Void) { - if #available(iOS 17, *) { - requestFullAccessToEvents { granted, error in - completion(granted, error) - } - } else { - requestAccess(to: .event) { granted, error in - completion(granted, error) - } +extension EKEventStore { + func requestCalendarAccess(completion: @escaping (Bool, Error?) -> Void) { + if #available(iOS 17, *) { + requestFullAccessToEvents { granted, error in + completion(granted, error) } - } - } -#else - extension EKEventStore { - func requestCalendarAccess(completion: @escaping (Bool, Error?) -> Void) { + } else { requestAccess(to: .event) { granted, error in completion(granted, error) } } } -#endif +} diff --git a/LoopFollow/Settings/GeneralSettingsView.swift b/LoopFollow/Settings/GeneralSettingsView.swift index e94a9040e..e552f076c 100644 --- a/LoopFollow/Settings/GeneralSettingsView.swift +++ b/LoopFollow/Settings/GeneralSettingsView.swift @@ -50,14 +50,12 @@ struct GeneralSettingsView: View { Toggle("Snoozer emoji", isOn: $snoozerEmoji.value) Toggle("Force portrait mode", isOn: $forcePortraitMode.value) .onChange(of: forcePortraitMode.value) { _ in - if #available(iOS 16.0, *) { - let window = UIApplication.shared.connectedScenes - .compactMap { $0 as? UIWindowScene } - .flatMap { $0.windows } - .first + let window = UIApplication.shared.connectedScenes + .compactMap { $0 as? UIWindowScene } + .flatMap { $0.windows } + .first - window?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations() - } + window?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations() } }