I don't fully understand the documentation for Meng To's Spring.
https://github.com/MengTo/Spring
The available functions given are
animate()
animateNext { ... }
animateTo()
animateToNext { ... }
and the example for chaining given is :
layer.y = -50
animateToNext {
layer.animation = "fall"
layer.animateTo()
}
I don't see anywhere where what these functions do is actually explained. Maybe it's super straight forward and I'm just missing it..
If I wanted to chain together 3 animations of lets just say the layer.animation = "fall" with this, what would an example of that look like and what's the difference between animateNext, animateTo, and animateToNext?
you are right that's those functions are not will documented so I faced the same questions when I wanted to implement animations with this library.
To chain 3 animations I do like that :
view.animation = "pop"
view.duration = 3
view.delay = 2
print("1")
view.animateToNext {
self.view.animation = "pop"
self.view.duration = 3
self.view.delay = 2
print("2")
self.view.animateToNext {
self.view.animation = "pop"
self.view.duration = 3
self.view.delay = 2
self.view.animate()
print("3")
}
}
It seems that animateNext doesn't wait the end of the previous animation to execute the next one, but animateToNext does it.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With