Skip to content

Commit

Permalink
Merge pull request pkluz#252 from stefanrenne/feature/fixed-CoreMotio…
Browse files Browse the repository at this point in the history
…n-causes-UI-API-called-on-a-background-thread

Fixed CoreMotion causes UI API called on a background thread
  • Loading branch information
PGLongo authored May 28, 2019
2 parents 6eb488e + d2d4bbd commit 2bb9dc8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions PKHUD/FrameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ internal class FrameView: UIVisualEffectView {

internal init() {
super.init(effect: UIBlurEffect(style: .light))
commonInit()
DispatchQueue.main.async {
self.commonInit()
}
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
commonInit()
DispatchQueue.main.async {
self.commonInit()
}
}

fileprivate func commonInit() {
private func commonInit() {
backgroundColor = UIColor(white: 0.8, alpha: 0.36)
layer.cornerRadius = 9.0
layer.masksToBounds = true

contentView.addSubview(self.content)
contentView.addSubview(content)

let offset = 20.0

Expand All @@ -45,7 +49,7 @@ internal class FrameView: UIVisualEffectView {
addMotionEffect(group)
}

fileprivate var _content = UIView()
private var _content = UIView()
internal var content: UIView {
get {
return _content
Expand Down

0 comments on commit 2bb9dc8

Please sign in to comment.