Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I slow down an animation with Facebook Pop?

I'm animating a view on the X-axis using Facebook Pop's spring animation. It works fine, except I can't seem to change the speed. It seems that the velocity property is the only way to do this from what I've read, but no values I set for it seem to have any effect. Am I doing something wrong, or is this a bug?

    POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
    anim.velocity = @(100.);
    anim.springBounciness = 15;
    anim.toValue = @(self.scrollView.frame.size.width/2);
    anim.beginTime = .05 * i + CACurrentMediaTime();
    [thisView.layer pop_addAnimation:anim forKey:@"myKey"];
like image 986
user3654985 Avatar asked Aug 30 '14 03:08

user3654985


1 Answers

try to experiment with those properties (of POPSpringAnimation class):

CGFloat dynamicsFriction
CGFloat dynamicsMass
CGFloat dynamicsTension
like image 162
Mateusz Avatar answered Oct 16 '22 23:10

Mateusz