Post

Replies

Boosts

Views

Activity

UIMotionEffect Not Working in iOS 14?
I'm trying to get a parallax effect similar to the home screen background. I've seen numerous examples of this working with a UIInterpolatingMotionEffect but I cannot get it to work on my iOS 14 devices (I've confirmed that the reduce motion setting is NOT enabled and the home screen background is moving like normal, so I know it works on my device). I've tried variations of this code, adding it to a view / button / label and nothing happens... any ideas? Thank you! let horizontal = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongHorizontalAxis) horizontal.minimumRelativeValue = -50 horizontal.maximumRelativeValue = 50 let vertical = UIInterpolatingMotionEffect(keyPath: "center.x", type: .tiltAlongVerticalAxis) vertical.minimumRelativeValue = -50 vertical.maximumRelativeValue = 50 let group = UIMotionEffectGroup() group.motionEffects = [horizontal, vertical] label.addMotionEffect(group)
8
0
1.7k
Sep ’20