Open Wenfengcheng opened 5 years ago
/// Check if device is iPhone X, /// reference: http://www.glimsoft.com/09/14/5-tips-tricks-for-updating-your-app-for-iphone-x/ static var isIphoneX: Bool { if #available(iOS 11, *) { guard let insets = UIApplication.shared.delegate?.window??.safeAreaInsets else { return false } return insets.top > CGFloat(0.0) } else { return false } }