Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chain-able animations #14

Closed
JakeLin opened this issue Dec 28, 2015 · 7 comments
Closed

Chain-able animations #14

JakeLin opened this issue Dec 28, 2015 · 7 comments

Comments

@JakeLin
Copy link
Member

JakeLin commented Dec 28, 2015

Better syntax for chaining animations.

Just an idea

Animation(view).pop(repeatCount: 2).then.shake(repeatCount:1).and.rotate(.cw, repeatCount:2)
@JakeLin JakeLin added this to the v5 milestone Feb 13, 2016
@shshalom
Copy link

shshalom commented Oct 6, 2016

Hi @JakeLin, Is there any chance to push this to an earlier version? that's my only blocker from using this great framework.

@JakeLin
Copy link
Member Author

JakeLin commented Oct 6, 2016

@shshalom I don't have any plan to work on this feature yet. If you would like to take the initiative, please go head, I will offer some help if I can.

@shshalom
Copy link

shshalom commented Oct 6, 2016

I might do that :-).

I wonder, how should we go about this. did you had anything in mind? maybe follow some other similar library that does it?

@JakeLin
Copy link
Member Author

JakeLin commented Oct 6, 2016

@shshalom great, I don't have a concrete idea how can we do it, I think there are a few ways we can try.

  1. Similar to https://github.com/Draveness/DKChainableAnimationKit
    which provides nice syntax like view.animation.makeScale(2.0).spring.animate(1.0), They provide an extension property called animation for all UIView objects in https://github.com/Draveness/DKChainableAnimationKit/blob/master/DKChainableAnimationKit/Classes/UIView%2BAnimationKit.swift#L15 . I don't think we need to do it as an extend method / property for UIView because we use protocol orientated programming pattern. It can be a property of Animatable protocol. They also used Objective-C black magic objc_getAssociatedObject because the library was ported from https://github.com/jhurray/JHChainableAnimations . I don't mind but we try to avoid it in IBAnimatable if possible.
  2. Some Promise / Future support like https://github.com/mxcl/PromiseKit, https://github.com/Thomvis/BrightFutures, or https://github.com/FutureKit/FutureKit
    They provide comprehensive features to control the flow of animations. I think they are overkill for animation library like IBAnimatable. I prefer to have a simple solution for both API usage and implementation. But their ideas can be reused in some place.
  3. Something simple I don't know yet.

We don't need to make a decision right now, we can have some spikes to try out different potential approaches. And make the decision once we get something. I think it will be a lot of fun😉 and a few of pains too.

@gkye
Copy link
Member

gkye commented Oct 6, 2016

https://github.com/AugustRush/Stellar is also a pretty good example

@shshalom
Copy link

shshalom commented Oct 7, 2016

@JakeLin Nice find, I'll get to it this weekend I hope.
I'll do some research and try to figure what would be the most simple and elegant approach.

@gkye Thanks for the link :-)

I'll post an update as soon I'll get some insights.

@tbaranes
Copy link
Member

tbaranes commented Jan 8, 2017

Closing in favor of #382

@tbaranes tbaranes closed this as completed Jan 8, 2017
@phimage phimage removed this from the 5.0 milestone May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants