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
|
// MARK: - UI
|
||||||
|
|
||||||
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||||
|
if UIDevice.current.isIPad {
|
||||||
|
return .all
|
||||||
|
}
|
||||||
|
|
||||||
return .allButUpsideDown
|
return .allButUpsideDown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,10 @@ class MediaGalleryNavigationController: UINavigationController {
|
||||||
// MARK: - Orientation
|
// MARK: - Orientation
|
||||||
|
|
||||||
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
public override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||||
|
if UIDevice.current.isIPad {
|
||||||
|
return .all
|
||||||
|
}
|
||||||
|
|
||||||
return .allButUpsideDown
|
return .allButUpsideDown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,10 @@ public class MediaTileViewController: UIViewController, UICollectionViewDataSour
|
||||||
// MARK: - UI
|
// MARK: - UI
|
||||||
|
|
||||||
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||||
|
if UIDevice.current.isIPad {
|
||||||
|
return .all
|
||||||
|
}
|
||||||
|
|
||||||
return .allButUpsideDown
|
return .allButUpsideDown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||||
|
|
||||||
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
||||||
if UIDevice.current.isIPad {
|
if UIDevice.current.isIPad {
|
||||||
return .allButUpsideDown
|
return .all
|
||||||
}
|
}
|
||||||
|
|
||||||
return .portrait
|
return .portrait
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
|
|
@ -13,12 +13,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
BOOL IsLandscapeOrientationEnabled(void)
|
BOOL IsLandscapeOrientationEnabled(void)
|
||||||
{
|
{
|
||||||
return NO;
|
return UIDevice.currentDevice.isIPad;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
|
UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
|
||||||
{
|
{
|
||||||
return (IsLandscapeOrientationEnabled() ? UIInterfaceOrientationMaskAllButUpsideDown
|
return (IsLandscapeOrientationEnabled() ? UIInterfaceOrientationMaskAll
|
||||||
: UIInterfaceOrientationMaskPortrait);
|
: UIInterfaceOrientationMaskPortrait);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue