So I have my clock as a UIImageView. Thats perfect the clock doesnt move. I am happy with that.
I am so have the hand of my clock as another UIImageView and it is placed on top of the clock ImageView.
I want to get my Hand of the clock to rotate 360degrees over 10 seconds, but the tricky part is that I want to make it rotate not on the origin at TopLeft of the clockhand ImageView put at a point 20,20 of the clockhand ImageView.
Here is my code so far, it rotates the clock hand 360degrees over 10seconds, but it rotates it around the topleft of the ImageView.
CABasicAnimation *rotate;
rotate = [CABasicAnimation
animationWithKeyPath:@"transform.rotation"];
rotate.fromValue = [NSNumber numberWithFloat:0];
rotate.toValue = [NSNumber numberWithFloat:6.283185307];
rotate.duration = 10.00;
rotate.repeatCount = 1;
needleImageView.layer.anchorPoint = CGPointMake(0.5, 0.5);
[needleImageView.layer addAnimation:rotate forKey:@"10"];
Anybody able to gimme some hints about getting this to rotate around the point 20,20 of needleImageView ?
Thanks, -Code