RBBAnimation icon indicating copy to clipboard operation
RBBAnimation copied to clipboard

RBBSpringAnimation animation doesn't work properly with AVPlayerLayer

Open kostiadombrovsky opened this issue 10 years ago • 1 comments

Not sure whether this is animation's or Apple's fault but if you attach a RBBSpringAnimation to an AVPlayerLayer weird stuff happens. Same animation works fine everywhere else.

kostiadombrovsky avatar May 26 '15 22:05 kostiadombrovsky

Funny thing - this hack works:

RBBSpringAnimation* animation = [RBBSpringAnimation animationWithKeyPath: keyPath];
animation.fromValue = fromValue;
animation.toValue = toValue;
animation.velocity  = velocity;
animation.mass      = mass;
animation.damping   = damping;
animation.stiffness = stiffness;
animation.duration = [animation durationForEpsilon: epsilon];


CAKeyframeAnimation* keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath: keyPath];
keyframeAnimation.values   = animation.values;
keyframeAnimation.keyTimes = animation.keyTimes;
keyframeAnimation.duration = animation.duration;
return keyframeAnimation;

kostiadombrovsky avatar May 26 '15 22:05 kostiadombrovsky