点击单元格时如何显示tableview单元格编辑视图?

时间:2017-01-30 08:20:45

标签: ios objective-c iphone swift ipad

我的要求是点击单元格时显示tableviewcell编辑视图。 " editActionsForRowAtIndexPath"滑动时正在工作,但点击单元格时我想要这个动作。enter image description here

2 个答案:

答案 0 :(得分:0)

我不知道你用什么刷卡。但是,如果您想在用户点击单元格时处理某些操作,则应使用didSelectRowAtIndexPath函数。例如;

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    print("Tapped")
}

答案 1 :(得分:0)

在didselect委托方法上使用此代码,我认为它会对您有所帮助。

self.tableView.editing = true