diff --git a/Source/UIView+Extensions.swift b/Source/UIView+Extensions.swift index f68a796..3e38514 100644 --- a/Source/UIView+Extensions.swift +++ b/Source/UIView+Extensions.swift @@ -11,4 +11,8 @@ extension UIView { return y } + + var isiPhoneX: Bool { + return safeYCoordinate > 20 + } } diff --git a/Source/WhistleFactory.swift b/Source/WhistleFactory.swift index 06d49e1..679ba2b 100644 --- a/Source/WhistleFactory.swift +++ b/Source/WhistleFactory.swift @@ -96,9 +96,12 @@ open class WhistleFactory: UIViewController { } func moveWindowToFront() { - let currentStatusBarStyle = UIApplication.shared.statusBarStyle - whistleWindow.windowLevel = UIWindowLevelStatusBar - UIApplication.shared.setStatusBarStyle(currentStatusBarStyle, animated: false) + whistleWindow.windowLevel = view.isiPhoneX ? UIWindowLevelNormal : UIWindowLevelStatusBar + setNeedsStatusBarAppearanceUpdate() + } + + open override var preferredStatusBarStyle: UIStatusBarStyle { + return UIApplication.shared.statusBarStyle } open func setupFrames() {