私はUILongPressGestureRecognizerを使用して、私のコードであるUIView内のタッチを追跡しています
-(void)tapGes:(UILongPressGestureRecognizer *)tapGesture
{
CGPoint location=[tapGesture locationInView:self.view];
UIView *view=tapGesture.view;
switch (tapGesture.state)
{
case UIGestureRecognizerStateBegan:
NSLog(@"enter");
break;
case UIGestureRecognizerStateEnded:
NSLog(@"ended");
break;
case UIGestureRecognizerStateChanged:
if (location.x>view.frame.size.width ||
location.y>view.frame.size.height)
{
NSLog(@"out");
return;
}
NSLog(@"change");
break;
default:
break;
}
}
状態 UIGestureRecognizerStateChanged のタッチが UIView から出たときに何をしたいので、状態 UIGestureRecognizerStateEnded に到達しないように、これを達成する方法はありますか?