From 36190e62f540e9ad96b72305dea418ab4d66d816 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 23 Nov 2025 13:41:03 +0100 Subject: [PATCH] Restrict orientation locking to iPhone only - Add device checks in Orientation enum to prevent locking on iPad - Hide "Lock portrait mode" setting on iPad in BrowsingSettings - Use Constants.isIPhone for consistent device detection --- Shared/Settings/BrowsingSettings.swift | 2 +- iOS/Orientation.swift | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Shared/Settings/BrowsingSettings.swift b/Shared/Settings/BrowsingSettings.swift index 04fb374f..0e5f58eb 100644 --- a/Shared/Settings/BrowsingSettings.swift +++ b/Shared/Settings/BrowsingSettings.swift @@ -185,7 +185,7 @@ struct BrowsingSettings: View { #if os(iOS) Toggle("Show Documents", isOn: $showDocuments) - if Constants.isIPad { + if Constants.isIPhone { Toggle("Lock portrait mode", isOn: $lockPortraitWhenBrowsing) .onChange(of: lockPortraitWhenBrowsing) { lock in if lock { diff --git a/iOS/Orientation.swift b/iOS/Orientation.swift index d86a2401..000af67c 100644 --- a/iOS/Orientation.swift +++ b/iOS/Orientation.swift @@ -6,6 +6,12 @@ enum Orientation { static var logger = Logger(label: "stream.yattee.orientation") static func lockOrientation(_ orientation: UIInterfaceOrientationMask) { + // Orientation locking is only for iPhone, not iPad + guard Constants.isIPhone else { + logger.info("skipping orientation lock on iPad") + return + } + if let delegate = AppDelegate.instance { delegate.orientationLock = orientation @@ -18,6 +24,12 @@ enum Orientation { } static func lockOrientation(_ orientation: UIInterfaceOrientationMask, andRotateTo rotateOrientation: UIInterfaceOrientation? = nil) { + // Orientation locking and rotation is only for iPhone, not iPad + guard Constants.isIPhone else { + logger.info("skipping orientation lock and rotation on iPad") + return + } + lockOrientation(orientation) guard let rotateOrientation else {