0

In

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

method I am doing some actions and in

- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

method I'm doing some other action.

If I'm tapping 3 times the touchesBegan will call 3 times. What I want is if the user continuously taps only the last touch action should perform. Is it possible or not?

4

1 回答 1

1

您可以尝试UITapGestureRecognizer改为,并在第一次点击后禁用它。

否则,您可以使用in和inperformSelector:withObject:afterDelay:的短暂延迟。touchesEnded:withEvent:cancelPreviousPerformRequestsWithTarget:selector:object:touchesBegan:withEvent:

那有意义吗?

于 2013-01-08T10:56:24.230 回答