Skip to content

Commit

Permalink
Always modify status bar overlay on main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
aydenp committed Dec 4, 2017
1 parent 980176a commit 00079f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Bank/Views/StatusBarOverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ class StatusBarOverlayView: UIView {
var isHairlineVisible = false {
didSet {
if isHairlineVisible == oldValue { return }
UIView.animate(withDuration: 0.1) { self.hairlineView.alpha = self.isHairlineVisible ? 1 : 0 }
func doAnimate() {
UIView.animate(withDuration: 0.15) { self.hairlineView.alpha = self.isHairlineVisible ? 1 : 0 }
}
if !Thread.isMainThread {
DispatchQueue.main.async { doAnimate() }
} else { doAnimate() }
}
}
}

0 comments on commit 00079f0

Please sign in to comment.