我想在按下一个单元格时将其悬停,但按下的时间太长。我尝试将最小按下时间设置为.05,但它不会影响识别器。
任何建议:
if (cell.gestureRecognizers.count==0) {
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(userCellTapped:)];
[tap setNumberOfTapsRequired:1];
//add a long press that kills the tap if recognized
UILongPressGestureRecognizer *press = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(userCellPressed:)];
[press setMinimumPressDuration:.05];
[press setNumberOfTouchesRequired:1];
[press requireGestureRecognizerToFail:tap];
[tap requireGestureRecognizerToFail:press];
[cell addGestureRecognizer:tap];
[cell addGestureRecognizer:press];
}