RBBAnimation
RBBAnimation copied to clipboard
RBBSpringAnimation animation doesn't work properly with AVPlayerLayer
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.
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;