【问题标题】:iOS 11 bug, didselectrowatindexpath calls tapping at cell with two fingers simultaneouslyiOS 11 错误,didselectrowatindexpath 调用同时用两根手指敲击单元格
【发布时间】:2017-09-24 21:25:28
【问题描述】:

这个问题出现在 ios11 上。我有一个带有 tableview 的常用屏幕,点击单元格用户转到详细信息屏幕。我在这个屏幕上没有手势识别器。接下来的步骤: 1)用tableview进入这个屏幕 2) 点击到单元格,转到详细信息屏幕 3)然后点击返回 4)尝试再次点击任何单元格,无操作 所以只有第一次调用selectrowatindexpath!进一步调查得出了一些结果: 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)
}

【问题讨论】:

  • 请出示相关代码。
  • 在哪里取消选择该行?除非你取消选择它,它仍然会被选中并且你不能再次选择它
  • @Paulw11 试过这个,没有成功
  • @honcharenko13 ,我也有同样的问题,你有解决办法吗

标签: ios swift uitableview ios11 didselectrowatindexpath


【解决方案1】:

找到了这种行为的原因。我使用 pod SwipeCellKit 来创建滑动操作。它阻止对 tableview 的任何操作。 本期链接https://github.com/SwipeCellKit/SwipeCellKit/issues/92

将您的 pod 文件中的此替换解析为

pod 'SwipeCellKit', :git => 'https://github.com/SwipeCellKit/SwipeCellKit.git', :branch => 'master'

【讨论】:

  • 我也有同样的问题,我正在使用 SwipeCellKit 。你有没有相同的解决方案,请告诉我。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-07
  • 1970-01-01
  • 2012-09-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多