[英]how to automatically slide/swipe the cell tableviewcell swift 3
You should implement delegate
method - commitEditingStyle
and you will be done!! 你应该实现
delegate
方法 - commitEditingStyle
,你将完成!
something like, 就像是,
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
{
// below code will delete one row - you can mange another kind of deletion here like delete from database also
if editingStyle == .Delete
{
yourDataArray.removeAtIndex(indexPath.row)
self.yourTableView.reloadData()
}
}
And you can do on button's click, 你可以按下按钮,
self.yourTableView.setEditing(true, animated: true)
to show (-) sign on every cells ! 在每个细胞上显示( - )标志!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.