Closed hackerpex closed 5 years ago
thanks a lot
Wrapping that piece of code with a dispatch async also solves the problem
DispatchQueue.main.async {
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]
self.addMotionEffect(group)
}
Created a PR for this https://github.com/pkluz/PKHUD/pull/252
merged the pr
I'm running 5.2.1 and still get this error. Is it not merged?
Updated my project to Xcode 10.2, Swift 5, cloned your repo and updated PKHUD to 5.2.2, and same Main Thread Checker error. This is on iPhone XR, btw.
this problem just block presentation on ios 12x only int IPhone X series
this part of code was commented and solve the problem
// 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)