I'm trying to change color of trash system image but it doesn't work for some reason.
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .normal, title: nil) { (ac: UIContextualAction, view: UIView, success: (Bool) -> Void) in
let cell = tableView.cellForRow(at: indexPath) as? HeroTableViewCell
if let _ = cell?.nameLabel.text {
self.deleteHeroName(index: indexPath)
}
success(true)
}
deleteAction.image = UIImage(systemName: "trash")?.withTintColor(.red)
return UISwipeActionsConfiguration(actions: [deleteAction])
}
I need it because I'm trying to give clear background to my delete action and image color is white.