为什么80%的码农都做不了架构师?>>>
注意UILongPressGestureRecognizer的使用,action在长按手势的 began和ended状态都会被调用一次。所以在action中应该对这两种状态有所区分。
- (void) handleLongPressAction:(UILongPressGestureRecognizer*)press { //解决响应两次的问题 if (press.state == UIGestureRecognizerStateEnded) { return; } else if (press.state == UIGestureRecognizerStateBegan) { //TODO}
}
这样就解决长按响应两次的问题。