Merge pull request #864 from f-person/feat/all-orientations-for-ipad
feat: Enable upside down orientation for iPad
This commit is contained in:
commit
19beff509b
|
@ -46,6 +46,10 @@ public class DocumentTileViewController: UIViewController, UITableViewDelegate,
|
|||
// MARK: - UI
|
||||
|
||||
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
if UIDevice.current.isIPad {
|
||||
return .all
|
||||
}
|
||||
|
||||
return .allButUpsideDown
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,10 @@ class MediaGalleryNavigationController: UINavigationController {
|
|||
// MARK: - Orientation
|
||||
|
||||
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
if UIDevice.current.isIPad {
|
||||
return .all
|
||||
}
|
||||
|
||||
return .allButUpsideDown
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,10 @@ public class MediaTileViewController: UIViewController, UICollectionViewDataSour
|
|||
// MARK: - UI
|
||||
|
||||
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
if UIDevice.current.isIPad {
|
||||
return .all
|
||||
}
|
||||
|
||||
return .allButUpsideDown
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -140,6 +140,7 @@
|
|||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<true/>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue