求: iOS单手指旋转View
高手给一段单手指能旋转View的代码 View 旋转 手势
[解决办法]
在UIPanGestureRecognizer的处理函数里面设置view的transform
view.transform = CGAffineTransformMakeRotation(radian);
[解决办法]
UIPanGestureRecognizer *pansGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePans:)];
[pansGesture setMaximumNumberOfTouches:1];
[self.rotationView addGestureRecognizer:pansGesture];
- (void)handlePans:(UIPanGestureRecognizer *)sender
{
CGPoint translationPoint = [sender velocityInView:self.view];
self.rotationView.transform = CGAffineTransformMakeRotation(sender.view.center.x+translationPoint.x);
}