Skip to content

Commit

Permalink
Merge pull request #196 from hyperoslo/fix/whistle
Browse files Browse the repository at this point in the history
Fix whistle
  • Loading branch information
onmyway133 authored Nov 22, 2017
2 parents 8109297 + 63bcdfb commit 010e249
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Source/UIView+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ extension UIView {

return y
}

var isiPhoneX: Bool {
return safeYCoordinate > 20
}
}
9 changes: 6 additions & 3 deletions Source/WhistleFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 010e249

Please sign in to comment.