I'm using swipe to delete in UITableView. In swipe I need to add image. When I add image it repeats. How to stop repeating
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let deleteButton = UITableViewRowAction(style: .default, title: "Delete") { (action, indexPath) in
self.tableView.dataSource?.tableView!(self.tableView, commit: .delete, forRowAt: indexPath)
return
}
deleteButton.backgroundColor = UIColor(patternImage: #imageLiteral(resourceName: "favourite_delete"))
deleteButton.title = ""
return [deleteButton]
}
Problem
What I need