Created
May 24, 2016 03:09
-
-
Save fhefh2015/19a92366a29610df0256588729c9ee87 to your computer and use it in GitHub Desktop.
CAAnimateGroup组合动画
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
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { | |
CABasicAnimation *baseAnimate1 = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
baseAnimate1.toValue = @(0.1); | |
baseAnimate1.duration = 0.5; | |
CABasicAnimation *baseAnimate2 = [CABasicAnimation animationWithKeyPath:@"position"]; | |
baseAnimate2.toValue = [NSValue valueWithCGPoint:CGPointMake(0, 0)]; | |
baseAnimate2.duration = 0.5; | |
CAAnimationGroup *animateGroup = [CAAnimationGroup animation]; | |
animateGroup.animations = @[baseAnimate1, baseAnimate2]; | |
animateGroup.removedOnCompletion = NO; | |
animateGroup.fillMode = kCAFillModeForwards; | |
[self.testView.layer addAnimation:animateGroup forKey:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment