I have 2 Images. 1 Outer Image and 1 Inner Image. I am trying to get the outer Image to rotate around the bounds of the inner Image. I am kind of close with the code I have (shown below) but I can't get the outer Image to perfectly rotate around the Inner Image.
CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = NO;
pathAnimation.duration = 5.0;
pathAnimation.repeatCount = 10;
CGMutablePathRef curvedPath = CGPathCreateMutable();
CGPathMoveToPoint(curvedPath, NULL, 10, 10);
CGRect rectangle = CGRectMake(self.view.frame.origin.x/2,self.view.frame.origin.y/2,200,200);
CGPathAddEllipseInRect(curvedPath, NULL, rectangle);
pathAnimation.path = curvedPath;
CGPathRelease(curvedPath);
[self.head.layer addAnimation:pathAnimation forKey:@"moveTheObject"];
Thanks for your help
EDIT** The inner Image is Circle around 180 x 180 px and the outer Image is a square. around 50 x 50 px.