facebookarchive / Keyframes

A library for converting Adobe AE shape based animations to a data format and playing it back on Android and iOS devices.
https://facebookincubator.github.io/Keyframes/
Other
5.33k stars 302 forks source link

Play Animation without repeating in iOS #59

Closed streamside7 closed 7 years ago

streamside7 commented 7 years ago

Thank you for this wonderful library. It's exactly what I need for an upcoming project. Great job! This definitely something I'd like to contribute to.

I'm just digging into the code right now, but I noticed in iOS, there is no equivalent to Android's stopAnimationAtLoopEnd so that the animation could only be played once. I've tried setRepeatCount (setting it both before and after starting the animation), and it still repeats.

Is there a simple way to play an animation just one iteration in iOS? Thanks!

streamside7 commented 7 years ago

I will answer my own question here: setRepeatCount does work; it just needed to be called before addSublayer is called (which makes sense now). Again, awesome job!

lozzle commented 7 years ago

thanks, @streamside7 glad you like the library!

in the future, we plan to consolidate our APIs on android vs ios so they match more closely, which should reduce the number of these types of issues 😄