[英]How to show tableview cell edit view when tap the cell?
My requirement is show the tableviewcell edit view when tap the cell. 我的要求是在点击单元格时显示tableviewcell编辑视图。 The "editActionsForRowAtIndexPath" is working when swipe but i want this action when tap the cell.
滑动时“editActionsForRowAtIndexPath”正在工作但我在点击单元格时需要此操作。 enter image description here
在此输入图像描述
I don't know what you use for swipe. 我不知道你用什么刷卡。 But if you want to handle some actions when the user tap the cell you should use didSelectRowAtIndexPath function.
但是,如果您想在用户点击单元格时处理某些操作,则应使用didSelectRowAtIndexPath函数。 For example;
例如;
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("Tapped")
}
Use this code on didselect delegate method, I think it will be help you. 在didselect委托方法上使用此代码,我认为它会对您有所帮助。
self.tableView.editing = true self.tableView.editing = true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.