How to slow down animation using Facebook Pop?

I am animating the view along the X axis using Facebook Pop spring animations. It works great, but I can’t change the speed. It seems that the velocity property is the only way to do this from what I read, but no values ​​that I set for it seem to have any effect. Am I doing something wrong, or is this a mistake?

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"]; 
+5
source share
2 answers

try experimenting with these properties (of the POPSpringAnimation class):

 CGFloat dynamicsFriction CGFloat dynamicsMass CGFloat dynamicsTension 
+12
source

The POPSpringAnimation springSpeed property is probably what you want. This is easier than dealing with three other lower-level properties (as mentioned by Mateusz). It defaults to 12.

+1
source

Source: https://habr.com/ru/post/1201460/


All Articles