iOS 11 错误,didselectrowatindexpath 调用同时用两根手指点击单元格
iOS 11 bug, didselectrowatindexpath calls tapping at cell with two fingers simultaneously
问题出现在 ios11。我有一个带有 tableview 的普通屏幕,点击单元格用户会转到详细信息屏幕。我在此屏幕上没有手势识别器。接下来的步骤:
1) 使用 tableview 转到此屏幕
2)点击单元格,转到详细信息屏幕
3) 然后点击返回
4)尝试再次点击任何单元格,没有任何动作
所以 dodselectrowatindexpath 只在第一次调用!进一步的调查给出了一些结果:
仅当您同时用两根手指点击单元格时,didselectrowatindexpath 才会调用!!!我无法解释这个。
相同的构建在 ios10 上运行良好。
有任何建议或有人有同样的问题吗?
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let timeReservations = currentReservations?.reservationsByTypes[indexPath.section]
let reservation = timeReservations?.reservations[indexPath.row]
let reservationMainVC = self.storyboard?.instantiateViewController(withIdentifier:
Globals.ReservationMainVCConstants.identifier) as! ReservationMainViewController
reservationMainVC.reservationId = reservation?.id
self.navigationController?.pushViewController(reservationMainVC, animated: true)
}
已找到此行为的原因。我使用 pod SwipeCellKit 来创建滑动操作。它阻止对 tableview 的任何操作。
Link 这个问题 https://github.com/SwipeCellKit/SwipeCellKit/issues/92
将 pod 文件中的此替换解决为
pod 'SwipeCellKit', :git => 'https://github.com/SwipeCellKit/SwipeCellKit.git', :branch => 'master'
问题出现在 ios11。我有一个带有 tableview 的普通屏幕,点击单元格用户会转到详细信息屏幕。我在此屏幕上没有手势识别器。接下来的步骤: 1) 使用 tableview 转到此屏幕 2)点击单元格,转到详细信息屏幕 3) 然后点击返回 4)尝试再次点击任何单元格,没有任何动作 所以 dodselectrowatindexpath 只在第一次调用!进一步的调查给出了一些结果: 仅当您同时用两根手指点击单元格时,didselectrowatindexpath 才会调用!!!我无法解释这个。 相同的构建在 ios10 上运行良好。 有任何建议或有人有同样的问题吗?
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let timeReservations = currentReservations?.reservationsByTypes[indexPath.section]
let reservation = timeReservations?.reservations[indexPath.row]
let reservationMainVC = self.storyboard?.instantiateViewController(withIdentifier:
Globals.ReservationMainVCConstants.identifier) as! ReservationMainViewController
reservationMainVC.reservationId = reservation?.id
self.navigationController?.pushViewController(reservationMainVC, animated: true)
}
已找到此行为的原因。我使用 pod SwipeCellKit 来创建滑动操作。它阻止对 tableview 的任何操作。 Link 这个问题 https://github.com/SwipeCellKit/SwipeCellKit/issues/92
将 pod 文件中的此替换解决为
pod 'SwipeCellKit', :git => 'https://github.com/SwipeCellKit/SwipeCellKit.git', :branch => 'master'