This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class var hasTopNotch: Bool { | |
if #available(iOS 11.0, tvOS 11.0, *) { | |
// with notch: 44.0 on iPhone X, XS, XS Max, XR. | |
// without notch: 20.0 on iPhone 8 on iOS 12+. | |
return UIApplication.shared.delegate?.window??.safeAreaInsets.top ?? 0 > 20 | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment