I have a program in which a CALayer has to be rotated to certain value. How can I determine the current rotation of a CALayer? I have a UIRotationGestureRecognizer that rotates the layer:
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer
{
if (gestureRecognizer == rotationGestureRecognizer) {
NSLog(@"gestureRecRotation: %f", rotationGestureRecognizer.rotation);
CATransform3D current = _baseLayer.transform;
_baseLayer.transform = CATransform3DRotate(current, rotationGestureRecognizer.rotation * M_PI / 180, 0, 0, 1.0);
}
}
I start with a layer that has to be rotated a certain amount to fit a puzzle. So how do I get the current rotation of the layer?