facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

Animation groups #275

Open naftaly opened 9 years ago

naftaly commented 9 years ago

Simple implementation of animation groups.

Use it as follows:

CALayer *layer = [CALayer layer];
POPGroupAnimation *group = [POPGroupAnimation animation];

POPBasicAnimation* anim1 = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerBorderWidth];
anim1.toValue = @(5);
anim1.duration = 5;

POPBasicAnimation* anim2 = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerCornerRadius];
anim2.toValue = @(20.0);
anim2.duration = 2;

group.animations = @[ anim1, anim2 ];

[layer pop_addAnimation:group forKey:@"group"];

Animations will run following the rules of the group ( pause, repeat, etc, ... ). Blocks and delegates will continue to function as they always have for the animations that are part of the group as well as the animation group.

The animation group completes only after all it's child animations are completed.

naftaly commented 9 years ago

possible implementation of https://github.com/facebook/pop/issues/215

mbrgm commented 8 years ago

Is this going to be merged?

danielreiser commented 8 years ago

+1

ghost commented 8 years ago

+1

bornbnid commented 8 years ago

+1

leotumwattana commented 8 years ago

+1

SaifAlDilaimi commented 7 years ago

+1