I want something similar as the Alarm app, where you can\'t swipe delete the row, but you can still delete the row in Edit mode.
When commented out tableView:commitE
You need to implement the CanEditRowAt function.
You can return .delete in the EditingStyleForRowAt function so you can still delete in editing mode.
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
if tableView.isEditing {
return true
}
return false
}
func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell.EditingStyle {
return .delete
}