Created
December 30, 2013 21:49
-
-
Save ariok/8188785 to your computer and use it in GitHub Desktop.
Group of animations in CA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
anim.fromValue = @(0.0); | |
anim.toValue = @(1.0); | |
CGPoint point = [self createPosition] | |
CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"position"]; | |
anim2.fromValue = [NSValue valueWithCGPoint:label.position]; | |
anim2.toValue = [NSValue valueWithCGPoint:point]; | |
CAAnimationGroup *group = [CAAnimationGroup animation]; | |
group.duration = 0.3; | |
group.autoreverses = NO; | |
group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; | |
group.removedOnCompletion = NO; | |
group.fillMode = kCAFillModeForwards; | |
group.animations = @[anim, anim2]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment