CAAnimationGroup 同时进行多个动画
_animateLayer.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.250].CGColor;
_animateLayer.borderWidth = 2;
_animateLayer.borderColor = [UIColor grayColor].CGColor;
CAAnimationGroup *group = [CAAnimationGroup animation];
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"bounds"];
animation.fromValue = [NSValue valueWithCGRect:_animateLayer.bounds];
animation.toValue = [NSValue valueWithCGRect: CGRectMake(0, 0, _animateLayer.bounds.size.width + 130,_animateLayer.bounds.size.height + 130)];
CABasicAnimation *bgAnimation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"];
bgAnimation.fromValue = (__bridge id)([UIColor colorWithWhite:1.000 alpha:0.250].CGColor);
bgAnimation.toValue = (__bridge id)([UIColor colorWithWhite:1.000 alpha:0].CGColor);
CABasicAnimation *borderAnimation = [CABasicAnimation animationWithKeyPath:@"borderColor"];
borderAnimation.fromValue = (__bridge id)([UIColor grayColor].CGColor);
borderAnimation.toValue = (__bridge id)([UIColor colorWithWhite:0.500 alpha:0.000].CGColor);
CABasicAnimation *cornerAnimation = [CABasicAnimation animationWithKeyPath:@"cornerRadius"];
cornerAnimation.fromValue = @(50);
cornerAnimation.toValue = @(115);
group.animations = @[animation,bgAnimation,borderAnimation,cornerAnimation];
group.repeatCount = MAXFLOAT;
group.duration = 1;
[_animateLayer addAnimation:group forKey:nil];
水!!
我厂广招各路大神加入:job.koudaitong.com
可以发简历到 tianchi@qima-inc.com O(∩_∩)O~