一、
CAKeyframeAnimation *path=[CAKeyframeAnimation animationWithKeyPath:@"position"];
//矩形的中心就是圆心
CGRect rect=CGRectMake(10, 20, 400, 300);
path.duration=5;
//绕此圆中心转
path.path=CFAutorelease(CGPathCreateWithEllipseInRect(rect, NULL));
path.calculationMode=kCAAnimationPaced;
path.rotationMode=kCAAnimationRotateAuto;
[view.layer addAnimation:path forKey:@"round"];
二、
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
//设置动画完成后保持原状
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
//值
animation.fromValue = [NSNumber numberWithFloat:0];
animation.toValue = [NSNumber numberWithFloat:M_PI];
animation.repeatCount = MAXFLOAT;
animation.duration = 2;
[view.layer addAnimation:animation forKey:@"transform"];
iOS开发交流群:301058503