123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import Foundation
- extension UIDevice {
- var hasNotch: Bool {
- if #available(iOS 11.0, *) {
- if UIApplication.shared.windows.isEmpty { return false }
- let top = UIApplication.shared.windows[0].safeAreaInsets.top
- return top > 20
- } else {
-
- return false
- }
- }
- }
- extension UIDeviceOrientation {
-
-
-
- var isLandscapeHardCheck: Bool {
- if UIDevice.current.orientation.isValidInterfaceOrientation {
- return UIDevice.current.orientation.isLandscape
- } else {
- return UIApplication.shared.windows.first?.windowScene?.interfaceOrientation.isLandscape ?? false
- }
- }
- }
|