首页 > 解决方案 > IndexPathForRowAtPoint 不工作 iOS 13.4.1

问题描述

我有一个填充了 UITableViewHeaders(部分)的 TableView ...标题上有一个 LongGesture,我使用下面的代码拖动标题以进行重新排序。现在这适用于我的所有设备,直到 13.3.1,但最近才收到用户抱怨 tableview 没有响应。以下是用于获取当前视图索引的简短代码,该视图在 iOS 13.4.1 之前有效,任何建议/解决方法将不胜感激

- (void)longPressGestureRecognized:(UILongPressGestureRecognizer*)longPress {

UIGestureRecognizerState state = longPress.state;    
CGPoint location = [longPress locationInView:self.mainTable];
NSIndexPath *indexPath = [self.mainTable indexPathForRowAtPoint:location];


//do my cool stuff  with index path....

}

标签: iosobjective-cuitableviewuigesturerecognizerios13.4

解决方案


推荐阅读