I\'m trying to make an key frame animation that lets a image view fly around a circle. I\'m using CGPathAddCurveToPoint
to make the key frame points. The proble
Would this do the trick?
CAKeyframeAnimation* circlePathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"center"];
CGMutablePathRef circularPath = CGPathCreateMutable();
CGRect pathRect = ...; // some rect you define. A circle has equal width/height; radius is half the values you specify here
CGPathAddEllipseInRect(circularPath, NULL, pathRect);
spinAnimation.path = circularPath;
CGPathRelease(circularPath);
You will notice the keypath of the animation is the center property of the UIView you wish to make fly around in a circle.