#define kDegreesToRadians(degrees) ((3.14159265359 * degrees)/180)
UIView *showView = [[UIViewalloc]initWithFrame:CGRectMake(100,100,100,100)];
[self.viewaddSubview:showView];
showView.backgroundColor = [UIColorredColor];
CAKeyframeAnimation *keyAnim = [CAKeyframeAnimationanimation];
keyAnim.keyPath =@"position"; /**
*常用的path有:
position:不限制方向和位置 position.x x方向的移动 position.y y方向的移动
bounds :放大缩小视图 bounds.size动画让视图变大和缩小
transform :可以做到旋转
transform.scale : 比例转换
transform.scale.x : 宽的比例转换
transform.scale.y : 高的比例转换
transform.rotation.z = 平面图的转换
keyAnim.repeatCount =MAXFLOAT;
keyAnim.duration =4;
keyAnim.removedOnCompletion =NO;
UIBezierPath *path2 = [UIBezierPathbezierPath];
[path2 addArcWithCenter:self.view.centerradius:100startAngle:0endAngle:kDegreesToRadians(360)clockwise:YES];
//圆形
keyAnim.path = path2.CGPath;
[showView.layeraddAnimation:keyAnimforKey:nil];