File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Sources/ContainerController Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import UIKit
1212public extension ContainerDevice {
1313 enum Orientation {
1414 case portrait
15+ case portraitUpsideDown
1516 case landscapeLeft
1617 case landscapeRight
1718 }
@@ -84,7 +85,7 @@ open class ContainerDevice {
8485 switch UIDevice . current. orientation {
8586 case . landscapeLeft, . landscapeRight:
8687 portrait = false
87- case . portrait:
88+ case . portrait, . portraitUpsideDown :
8889 portrait = true
8990 default : break
9091 }
@@ -107,6 +108,13 @@ open class ContainerDevice {
107108
108109 class public var orientation : ContainerDevice . Orientation {
109110 if isPortrait {
111+ if let statusBarOrientation = statusBarOrientation {
112+ if statusBarOrientation == . portrait {
113+ return . portrait
114+ } else if statusBarOrientation == . portraitUpsideDown {
115+ return . portraitUpsideDown
116+ }
117+ }
110118 return . portrait
111119 } else {
112120 if let statusBarOrientation = statusBarOrientation {
@@ -124,7 +132,7 @@ open class ContainerDevice {
124132public extension UIDeviceOrientation {
125133
126134 var isRotateAllowed : Bool {
127- return !( face || self == . portraitUpsideDown )
135+ return !face
128136 }
129137
130138 var face : Bool {
You can’t perform that action at this time.
0 commit comments