Post

Replies

Boosts

Views

Activity

Reply to Determining Landscape Left and Landscape Right?
extension UIViewController {     var deviceOrientation:UIDeviceOrientation {         guard let window = view.window else { return .unknown }         let fixedPoint = window.screen.coordinateSpace.convert(CGPoint.zero, to: window.screen.fixedCoordinateSpace)         if fixedPoint.x == 0 {             if fixedPoint.y == 0 { return .portrait }             return .landscapeRight         } else {             if fixedPoint.y == 0 { return .landscapeLeft }             return .portraitUpsideDown         }     } }
Jun ’21