Skip to content

Commit

Permalink
temporary HUD hack to fix Main Thread Checker error
Browse files Browse the repository at this point in the history
* see pkluz#245 (with my comment)
* see pkluz#251 - which documents an attempted fix in pull request pkluz/PKHUD/pkluz#252
* see another attempt which just conditionally enables the code - pkluz/PKHUD/pkluz#260
  • Loading branch information
NickAger committed Sep 18, 2019
1 parent be74f5e commit feaa96c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions PKHUD/FrameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ internal class FrameView: UIVisualEffectView {

contentView.addSubview(content)

let offset = 20.0

let motionEffectsX = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis)
motionEffectsX.maximumRelativeValue = offset
motionEffectsX.minimumRelativeValue = -offset

let motionEffectsY = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis)
motionEffectsY.maximumRelativeValue = offset
motionEffectsY.minimumRelativeValue = -offset

let group = UIMotionEffectGroup()
group.motionEffects = [motionEffectsX, motionEffectsY]

addMotionEffect(group)
// let offset = 20.0
//
// let motionEffectsX = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis)
// motionEffectsX.maximumRelativeValue = offset
// motionEffectsX.minimumRelativeValue = -offset
//
// let motionEffectsY = UIInterpolatingMotionEffect(keyPath: "center.y", type: .tiltAlongVerticalAxis)
// motionEffectsY.maximumRelativeValue = offset
// motionEffectsY.minimumRelativeValue = -offset
//
// let group = UIMotionEffectGroup()
// group.motionEffects = [motionEffectsX, motionEffectsY]
//
// addMotionEffect(group)
}

private var _content = UIView()
Expand Down

0 comments on commit feaa96c

Please sign in to comment.