如何使用
NSUndoManager
和旋转手势来旋转UIImageView
?以下是我的旋转代码。- (void)handleRotate:(UIRotationGestureRecognizer *)recognizer
{
if (recognizer.state == UIGestureRecognizerStateBegan) {
prevRotation = 0.0;
}
float thisRotate = recognizer.rotation - prevRotation;
prevRotation = recognizer.rotation;
recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, thisRotate);
CGPoint lastpoint = point;
}