I try to make my view rotate as long as it goes through the path (linear path) but it doesn't rotate.
This is my code:
CAKeyframeAnimation *animKF = [CAKeyframeAnimation animationWithKeyPath:@"position"];
animKF.values = [NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(100, 100)], [NSValue valueWithCGPoint:CGPointMake(400, 400)], [NSValue valueWithCGPoint:CGPointMake(700, 100)], [NSValue valueWithCGPoint:CGPointMake(1000, 400)], nil];
animKF.keyTimes = [NSArray arrayWithObjects:[NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:0.25], [NSNumber numberWithFloat:0.5], [NSNumber numberWithFloat:1.0], nil];
animKF.duration = 6;
animKF.rotationMode = kCAAnimationRotateAuto;
[imageView.layer addAnimation:animKF forKey:@"keyframe"];
But the imageView (the blue face in the picture) doesn't rotate along the path (the red line in the picture)
Thank you so much.