Created
December 4, 2013 02:34
-
-
Save cyndibaby905/7781375 to your computer and use it in GitHub Desktop.
Animation issues
This file contains 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 *positionAnimation; | |
positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; | |
positionAnimation.fromValue = [NSValue valueWithCGPoint:fromPosition]; | |
positionAnimation.toValue = [NSValue valueWithCGPoint:toPosition]; | |
CABasicAnimation *alphaAnimation; | |
alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
alphaAnimation.fromValue = [NSNumber numberWithFloat:fromAlpha]; | |
alphaAnimation.toValue = [NSNumber numberWithFloat:toAlpha]; | |
CABasicAnimation* scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
scaleAnimation.fromValue = [NSNumber numberWithFloat:fromScale]; | |
scaleAnimation.toValue = [NSNumber numberWithFloat:toScale]; | |
CAAnimationGroup *group = [CAAnimationGroup animation]; | |
[group setAnimations:[NSArray arrayWithObjects: alphaAnimation, positionAnimation, scaleAnimation, nil]]; | |
group.duration = duration; | |
group.removedOnCompletion = YES; | |
group.beginTime = CACurrentMediaTime() + delayInSeconds; | |
[view.layer addAnimation:group forKey:@"dropAnimation"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment