我制作了自定义TableViewCell并添加了“滑动动作”以删除
我想根据我的自定义单元格高度来更改动作高度
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let contextItem = UIContextualAction(style: .destructive, title: "Delete") { (contextualAction, view, boolValue) in
self.array.remove(at: indexPath.row)
self.tableView.deleteRows(at: [indexPath], with: .automatic)
boolValue(true)
self.tableView.reloadData()
}
let swipeActions = UISwipeActionsConfiguration(actions: [contextItem])
return swipeActions
}
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
}