RBBAnimation
RBBAnimation copied to clipboard
[WIP] Add RBBRubberbandAnimation
This adds RBBRubberbandAnimation, which is an alternative to RBBSpringAnimation and CASpringAnimation that is optimized for CGPoint animations and correctly handles the velocity paramter, even if ∆x or ∆y are 0.
RBBRubberbandAnimation *rubberband = [RBBRubberbandAnimation animationWithKeyPath:@"position"];
rubberband.from = CGPointMake(0, 0);
rubberband.to = CGPointMake(0, 0);
rubberband.mass = 1;
rubberband.damping = 10;
rubberband.stiffness = 100;
rubberband.velocity = CGPointMake(400, 0);
RBBSpringAnimation will remain as an alternative to CASpringAnimation.
I realize a scalar rubberband animation would still desirable for animating scale or rotation…
RBB2DRubberbandAnimation + RBBScalarRubberbandAnimation ? :unamused: