【发布时间】:2017-07-19 12:50:02
【问题描述】:
我在Xib 中使用tableViewCell。
在表格视图中,didSelectRowAt 函数仅在我长按tableViewCell 时被调用
我的代码在下面
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
categorytabelview.deselectRow(at: indexPath, animated: true)
self.categorylabel.text = totalArrayofCars.object(at: indexPath.row) as? String
categorytabelview.isHidden = true
}
我想在单选中选择tabelViewCell 数据,而不是长按。
【问题讨论】:
-
上面有没有添加手势识别器?
-
不,我没有添加任何手势识别器
-
为什么在选择单元格后取消选择行?
-
是的,我评论了这一行 categorytabelview.deselectRow(at: indexPath, animated: true) 我运行我的代码,我得到了同样的错误
-
你在使用第三方库吗?
标签: ios swift uitableview swift3