diff --git a/Session/Media Viewing & Editing/DocumentTitleViewController.swift b/Session/Media Viewing & Editing/DocumentTitleViewController.swift index d7a84d87e..b651a62cc 100644 --- a/Session/Media Viewing & Editing/DocumentTitleViewController.swift +++ b/Session/Media Viewing & Editing/DocumentTitleViewController.swift @@ -46,6 +46,10 @@ public class DocumentTileViewController: UIViewController, UITableViewDelegate, // MARK: - UI override public var supportedInterfaceOrientations: UIInterfaceOrientationMask { + if UIDevice.current.isIPad { + return .all + } + return .allButUpsideDown } diff --git a/Session/Media Viewing & Editing/MediaGalleryNavigationController.swift b/Session/Media Viewing & Editing/MediaGalleryNavigationController.swift index cd9062186..55283edec 100644 --- a/Session/Media Viewing & Editing/MediaGalleryNavigationController.swift +++ b/Session/Media Viewing & Editing/MediaGalleryNavigationController.swift @@ -44,6 +44,10 @@ class MediaGalleryNavigationController: UINavigationController { // MARK: - Orientation public override var supportedInterfaceOrientations: UIInterfaceOrientationMask { + if UIDevice.current.isIPad { + return .all + } + return .allButUpsideDown } diff --git a/Session/Media Viewing & Editing/MediaTileViewController.swift b/Session/Media Viewing & Editing/MediaTileViewController.swift index 5d24475b9..393e8411c 100644 --- a/Session/Media Viewing & Editing/MediaTileViewController.swift +++ b/Session/Media Viewing & Editing/MediaTileViewController.swift @@ -54,6 +54,10 @@ public class MediaTileViewController: UIViewController, UICollectionViewDataSour // MARK: - UI override public var supportedInterfaceOrientations: UIInterfaceOrientationMask { + if UIDevice.current.isIPad { + return .all + } + return .allButUpsideDown } diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index efb70ee58..5bcd917c5 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -248,7 +248,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { if UIDevice.current.isIPad { - return .allButUpsideDown + return .all } return .portrait diff --git a/Session/Meta/Session-Info.plist b/Session/Meta/Session-Info.plist index 87cdc72f3..6e30c5bc2 100644 --- a/Session/Meta/Session-Info.plist +++ b/Session/Meta/Session-Info.plist @@ -140,6 +140,7 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown UIViewControllerBasedStatusBarAppearance diff --git a/SignalUtilitiesKit/Shared View Controllers/OWSViewController.m b/SignalUtilitiesKit/Shared View Controllers/OWSViewController.m index c35b43035..bca4d0a94 100644 --- a/SignalUtilitiesKit/Shared View Controllers/OWSViewController.m +++ b/SignalUtilitiesKit/Shared View Controllers/OWSViewController.m @@ -13,12 +13,12 @@ NS_ASSUME_NONNULL_BEGIN BOOL IsLandscapeOrientationEnabled(void) { - return NO; + return UIDevice.currentDevice.isIPad; } UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void) { - return (IsLandscapeOrientationEnabled() ? UIInterfaceOrientationMaskAllButUpsideDown + return (IsLandscapeOrientationEnabled() ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait); }