Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Provide a way to chain animations #34

Open
alexiscreuzot opened this issue Apr 30, 2014 · 17 comments
Open

Provide a way to chain animations #34

alexiscreuzot opened this issue Apr 30, 2014 · 17 comments

Comments

@alexiscreuzot
Copy link

A great addition to this library would be to provide a way to chain animations by passing an array of POPAnimation instances to [POPAnimator sharedAnimator] for example.

@kimon
Copy link
Contributor

kimon commented Apr 30, 2014

There are two ways to currently chain animations. One approach, is to set the animation beginTime to some offset from CACurrentMediaTime(). Another approach, if solely focused on starting the next animation when the previous one completes, is to use the delegate/completion handler to start the next one. Do either of these work? If not, could you elaborate a little more on what you're trying to accomplish?

@RuiAAPeres
Copy link
Contributor

@kimon does Pop provide something CAAnimationGroup? I guess that's what @kirualex is refering to.

@alexiscreuzot
Copy link
Author

@RuiAAPeres @kimon delegation/completion handlers work quite well but as soon as you handle multiple animations (in sequence or not), it quickly becomes spaghetti.
An approach like CPAnimationSequence to queue animations could result in more clear and maintainable code.

@grp
Copy link
Contributor

grp commented May 1, 2014

The completionBlock property might allow declaring chained animations in an easier-to-understand manner, since it would let the code for all of the animations stay in the same place.

@oisinlavery
Copy link

In the JS world TweenMax/TimelineMax are the most developed animation frameworks. Take a look if you are looking for inspiration on how chaining of animations could be done in a really simple yet powerful way.

http://www.greensock.com/get-started-js/#sequencing

This lib is so flexible, it's only limitation is the platform. I'd love to have something like this in POP.

@hfossli
Copy link
Contributor

hfossli commented Jun 12, 2014

Does it make sense in a simulation context (pause, reverse, seek etc)? I mean pop isn't just about tweening, but also about adding dynamics to any object. I don't know if dynamics should be reversed, paused etc. Especially not seeked because duration of say a spring animation is not known up front. I guess one could do the reversing by just flip around the from- and to-values, but other than that? To me it seems like if these things were added it could very likely be slowing down further development of pop.

@martin-c0des
Copy link

I am too trying to create a sequence of animations by passing elements to a function like so: func slideLabelsOut(labelArguments: UILabel...) { perform animations }. The thing is currently I have to hardcode the animation for each label so they start one after the other by using CACurrentMediaTime(). It's a lot of repetitive code and it's not really pretty.

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@freak4pc
Copy link

Anything new?

@mitchellporter
Copy link

+1 this would be awesome

@manuelescrig
Copy link

+1 Any news?

@Antanas
Copy link

Antanas commented Mar 18, 2017

+1

@fernandomatal
Copy link

+1, still waiting for any news

@RuiAAPeres
Copy link
Contributor

I don't think this project, at this point in time, is being actively maintained. So @fernandolicon I wouldn't count on this feature. 😞

@fernandomatal
Copy link

@RuiAAPeres yeah, I just saw that last update was some time ago. Thanks for the heads up, I would keep using delegate methods 😕

@mxcl
Copy link

mxcl commented Feb 12, 2018

This is totally out of scope of this very well defined and well encapsulated library. If you want chaining use another library that is designed for chaining, eg. PromiseKit. Adding chaining to pop would spoil pop a little bit.

@Huang-Libo
Copy link

Huang-Libo commented Dec 3, 2018

related pull request:
#275

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests