facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

Repeat "shake" animation : repeatForever doesn't work #328

Open andrealufino opened 8 years ago

andrealufino commented 8 years ago

Hello guys, I don't know if this is a bug (I don't think so) or an expected behavior, but I'm trying to do this :

let rotation = POPSpringAnimation.init(propertyNamed: kPOPLayerRotation)
rotation.springBounciness = 30
rotation.springSpeed = 20
rotation.velocity = 30.0
rotation.repeatForever = true

button.layer.pop_addAnimation(rotation, forKey: "rotation")

But the repeatForever seems to be ignored completely and the animation doesn't repeat. How can I create this effect repeating it until I want to stop it?

warpling commented 8 years ago

Maybe it's not in the provided code but did you set a toValue for the animation?