在一个表格视图中,我在每个单元格上都有一个UILongPressGestureRecognizer
我这样添加的:
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(TableCellLongPressed:)];
longPress.minimumPressDuration = 0.5f;
[cell addGestureRecognizer:longPress];
[longPress release];
现在我确实遇到了以下问题,我希望用户能够重新排列 tableview 中的单元格,所以我有一个按钮可以将 tableView 设置为 EditMode,如下所示:
[self.myTableView setEditing:!self.myTableView.editing animated:YES];
现在,当用户尝试拖动一个单元格并且没有将其拖动足够远时,longPress 会触发他的动作,这对用户来说非常烦人,因为另一个视图被推送。UILongPressGestureRecognizer
当 tableView 处于 EditMode 时,如何暂停或禁用?