Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as solved with 8 replies, 0 views
Replied In
UIMotionEffect Not Working in iOS 14?
I filed FB8369431 for this bug too.
I noticed that the problem is that the motion effect can't be added to the view. Immediately after adding it you can see that view.motionEffects is still empty.
I haven't had time to do this, but it might help to use Hopper Dissasembler to look at the addMotionEffect implementation. Maybe there is a permission check we are failing, such as a new undocumented requirement to access the accelerometer data?
Here is the very easy repro:
let effect = UIInterpolatingMotionEffect(keyPath: "center.x",type: .tiltAlongHorizontalAxis)
effect.minimumRelativeValue = -10
effect.maximumRelativeValue = 10
blueView.addMotionEffect(effect)
if blueView.motionEffects.count == 0 {
print("Oh no! Why didn't the effect get added? :'( ")
}