File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,8 @@ import UIKit
155155 print ( " \( OrientationDirectorImpl . TAG) - requestGeometryUpdate error " , error)
156156 }
157157 } else {
158- UIDevice . current. setValue ( mask. rawValue, forKey: " orientation " )
158+ let interfaceOrientation = self . utils. convertToInterfaceOrientationFrom ( mask: mask)
159+ UIDevice . current. setValue ( interfaceOrientation. rawValue, forKey: " orientation " )
159160 UIViewController . attemptRotationToDeviceOrientation ( )
160161 }
161162 }
Original file line number Diff line number Diff line change @@ -78,6 +78,21 @@ class Utils {
7878 }
7979 }
8080
81+ public func convertToInterfaceOrientationFrom( mask: UIInterfaceOrientationMask ) -> UIInterfaceOrientation {
82+ switch mask {
83+ case . portrait:
84+ return . portrait
85+ case . landscapeRight:
86+ return . landscapeRight
87+ case . portraitUpsideDown:
88+ return . portraitUpsideDown
89+ case . landscapeLeft:
90+ return . landscapeLeft
91+ default :
92+ return . unknown
93+ }
94+ }
95+
8196 public func getInterfaceOrientation( ) -> UIInterfaceOrientation {
8297 guard let windowScene = self . getCurrentWindow ( ) ? . windowScene else {
8398 return UIInterfaceOrientation . unknown
You can’t perform that action at this time.
0 commit comments