I am creating a CAShapeLayer. I am adding rotation animation to it. Somehow transformation result is weird. The child layer is moving along with rotation. I need it to be in
It works right. Just enable frame for your layer:
circleLayer.borderWidth = 1;
circleLayer.borderColor = [UIColor redColor].CGColor;
And you see that frame rotating right. Also better to use byValue here:
CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
animation.byValue = @(2 * M_PI);
animation.duration = 10.0f;
animation.repeatCount = INFINITY;
animation.removedOnCompletion = NO;
[circleLayer addAnimation:animation forKey:@"SpinAnimation"];
So your problem is a geometry of shape.