how do i calculate the angle of rotation for any given object (ie a uiimageview)?
You can easily get the angle of the rotation like this:
CGFloat angle = [(NSNumber *)[view valueForKeyPath:@"layer.transform.rotation.z"] floatValue];
For example:
view.transform = CGAffineTransformMakeRotation(0.02);
CGFloat angle = [(NSNumber *)[view valueForKeyPath:@"layer.transform.rotation.z"] floatValue];
NSLog(@"%f", angle); // 0.020000
From the documentation:
Core Animation extends the key-value coding protocol to allow getting and setting of the common values of a layer's CATransform3D matrix through key paths. Table 4 describes the key paths for which a layer’s transform and sublayerTransform properties are key-value coding and observing compliant