UILongPressGestureRecognizer多次执行

在响应事件方法里加个判断

1
2
3
UILongPressGestureRecognizer *longGes = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longGesAction:)];

[self addGestureRecognizer:longGes];
1
2
3
4
5
- (void)longGesAction:(UILongPressGestureRecognizer *)longGes {
if (longGes.state == UIGestureRecognizerStateBegan) {
self.selectCellBlcok(self.indexPath);
}
}