I'm rotating an UIImageView with following code:
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
[rotate setFromValue:[NSNumber numberWithFloat:0.0]];
[rotate setToValue:[NSNumber numberWithFloat:-0.34906585)]];
[rotate setDuration:0.8];
[rotate setTimingFunction:[CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut]];
rotate.removedOnCompletion = NO;
rotate.fillMode = kCAFillModeForwards;
[myUIImageView.layer addAnimation:rotate forKey:@"dangleMyDial"];
But each time I call this function it start rotating the image from its original position. What should I use for [rotate setFromValue: ]; to make it rotate from where it currently is? is there any property showing the current angle?
(0.34906585 Rad is equal to 20Deg)