I want to make a blur effect that will gradually cover the screen when the device moves. For example, I started shooting a video, turned the device a little, the blur effect starts to appear at the edges of the screen. Moving the device is intercepted via Core Motion a via CMMotionManager and I process the CMAttitude * attitude = motion.attitude I made the effect using CAShapeLayer and I just painted a “hole” on one layer, and the neighborhood of this hole has alpha = 0.5 and creates a blur effect as it were. Now I want to increase / decrease this hole depending on the position of the device. If you deviate from the initial position, the hole will decrease and the whole screen will be covered with a layer. To animate the increase in the hole is obtained through CABasicAnimation ,
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"path"]; animation.duration = 1; animation.fromValue = oldValue; animation.toValue = newValue; but the animation doesn’t fit here, because the function that is called when the device moves is called very often (timeInterval = 0.01 for CMMotionManager), so every time the animation doesn’t work, the manual path cannot be changed either (I tried changing the for loop) in CALayer, the last modified path was always displayed, not the process). I hope I explained well what I need, if you have any ideas, then velkam.
ab-filter(piece for 'smoothing down' the data from the instruments) andCADisplayLink(the timer that is called when the screen is redrawn). - Gralex