我正在寻找一个我能抓住的适当事件。捏效果很好。只有在
之前没有夹点时,以下行才有效- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event
{
NSLog(@"---> event");
}
似乎捏紧了以下的触摸。
无论如何在此代码中识别出补漆
- (void)scalePiece:(UIPinchGestureRecognizer *)gestureRecognizer
{
//[self adjustAnchorPointForGestureRecognizer:gestureRecognizer];
NSLog(@"scalePiece");
if ([gestureRecognizer state] == UIGestureRecognizerStateBegan || [gestureRecognizer state] == UIGestureRecognizerStateChanged) {
[gestureRecognizer view].transform = CGAffineTransformScale([[gestureRecognizer view] transform], [gestureRecognizer scale], [gestureRecognizer scale]);
[gestureRecognizer setScale:1];
}
}
如何在捏视图后识别最后/第二根手指的触摸?或者更好地说,我如何区分夹点移动和夹点结束?
欢呼声
答案 0 :(得分:8)
您可以使用:
if ([gestureRecognizer state] == UIGestureRecognizerStateEnded)
在你的捏合功能