I am applying an rotation transform animation in an animation block with this transform:
CATransform3D rotatedTransform = self.layer.transform;
rotatedTransf
You can retrieve the current state of an animating layer by grabbing its presentationLayer. Assuming that you have not applied any other transformations to the layer, you can extract the current angle of the rotating layer using code like the following:
CATransform3D rotationTransform = [(CALayer *)[self.layer presentationLayer] transform];
float angle;
if (rotationTransform.m11 < 0.0f)
angle = 180.0f - (asin(rotationTransform.m12) * 180.0f / M_PI);
else
angle = asin(rotationTransform.m12) * 180.0f / M_PI;
In an otherwise unmodified transform, the m11 and m12 values are coordinates that lie on the unit circle, so you can use trigonometry to determine the angle they describe.
EDIT (5/18/2009): Added a typecast to CALayer to overcome compiler warnings and fixed the naming of the transform in the trigonometry operations.