CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];
transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.2, 1.2, 1.0)]; transformAnimation.beginTime = CACurrentMediaTime();
transformAnimation.duration = 2.0f;
transformAnimation.repeatCount = HUGE_VALF;
transformAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[hh.layer addAnimation:transformAnimation forKey:@"transformAnimation"];
纵横四海一个呼吸灯动画,但是有个问题,每当界面跳转再回来,动画就没了
解决: 加一句transformAnimation.removedOnCompletion = NO;