How do I slow down an animation with Facebook Pop?
Asked Answered
C

2

5

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"];
Claudioclaudius answered 30/8, 2014 at 3:51 Comment(0)
H
12

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

CGFloat dynamicsFriction
CGFloat dynamicsMass
CGFloat dynamicsTension
Hayley answered 30/8, 2014 at 7:25 Comment(1)
This should be marked as solved. Those are exactly the properties you need for this.Deadly
L
1

The POPSpringAnimation springSpeed property is probably what you want. It's easier than having to mess with the 3 other lower level properties (as mentioned by Mateusz). It defaults to 12.

Linkoski answered 29/7, 2015 at 4:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.