夹点识别后夹点结束还是修补?

时间:2011-04-14 13:41:45

标签: iphone objective-c ios ipad uigesturerecognizer

我正在寻找一个我能抓住的适当事件。捏效果很好。只有在

之前没有夹点时,以下行才有效
- (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];
    }
}

如何在捏视图后识别最后/第二根手指的触摸?或者更好地说,我如何区分夹点移动和夹点结束?

欢呼声

1 个答案:

答案 0 :(得分:8)

您可以使用:

if ([gestureRecognizer state] == UIGestureRecognizerStateEnded)

在你的捏合功能