123456789101112131415161718192021222324252627282930313233343536 |
- import UIKit
- extension UIApplication {
-
- var isLandscape: Bool {
- if UIDevice.current.orientation.isValidInterfaceOrientation {
- return UIDevice.current.orientation.isLandscape
- } else if #available(iOS 13.0, *) {
- return windows.first?.windowScene?.interfaceOrientation.isLandscape ?? false
- } else {
- return statusBarOrientation.isLandscape
- }
- }
- }
|