//抽象类 特点 不能创建对象
UIRotationGestureRecognizer *rotation = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewroRotation:)];
rotation.delegate = self;
//设置属性 点击此次 1单击 2双击
//手势View 对象 添加给UIImageView
[imgView addGestureRecognizer:rotation];
}
#pragma mark - 点击手势触发事件
-(void)imageViewroRotation:(UIRotationGestureRecognizer *)rotation
{
NSLog(@"识别到了旋转手势");
//缩放 移动 旋转 都是通过transform
rotation.view.transform = CGAffineTransformRotate(rotation.view.transform, rotation.rotation);
//旋转角度 rotation
rotation.rotation = 0.0;
}
转载请注明出处:http://blog.csdn.net/sevenquan