How can I repeat animation (using UIViewPropertyAnimator) certain number of times?
问题 I want to achieve pulsation effect for the button, and hence need to repeat the spring effect several number of times, the issue is that I can't find any information about what parameters to provide and how to do it let btnView = sayWordBtn.viewWithTag(0) btnView.transform = CGAffineTransform(scaleX: 0.7, y: 0.7) let mass: CGFloat = 2.0 // weight of the object let stiffness: CGFloat = 25.0 //elasticity let damping: CGFloat = 2*sqrt(mass*stiffness) // point where the system comes to rest in