Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Support key frame animations #53

Open
joshaber opened this issue Apr 11, 2013 · 5 comments
Open

Support key frame animations #53

joshaber opened this issue Apr 11, 2013 · 5 comments

Comments

@joshaber
Copy link
Member

It'd be nice if there were first-class support for key frame animations. I'm not totally sure what that would look like. Maybe an operator like -sequenceNext: but that completes when the animation completes? It'd be kinda dumb-guy keyframing but it'd work.

@jspahrsummers
Copy link
Member

Can you do this with -doAnimationCompleted:?

@joshaber
Copy link
Member Author

Not really. There's no good way to run a CAKeyframeAnimation manually with the animator proxy. For the dumb-guy version, the block would need to return a new signal to use to set the keypath.

@joshaber
Copy link
Member Author

In other words, something like:

RAC(self.view.rcl_frame) = [[[RACSignal return:frame1] animateWithDuration:0.3] animateNext:^{
    return [[RACSignal return:frame2] animateWithDuration:0.6];
}];

Where -animateNext: only continues to its block after the other animation has completed.

@jspahrsummers
Copy link
Member

Maybe this should involve a tuple representation:

RACSignal *frames = [RACSignal return:RACTuplePack(frame1, frame2)];
RAC(self.view.rcl_frame) = [frames animateKeyframesWithDurations:@[ @0.3, @0.6 ]];

The API is a bit more unwieldy (at least in terms of composability), but it's translatable to a single CAKeyframeAnimation, so there are no timing issues with paused or delayed run loops.

@joshaber
Copy link
Member Author

Ehh, that API's fairly gross but I don't have any better suggestions :\

This was referenced Apr 12, 2013
@ghost ghost assigned joshaber Apr 22, 2013
@joshaber joshaber removed their assignment May 20, 2019
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

2 participants