I have a UITableView that has a list of UITableViewCells with custom corner radiuses. When swiping to edit, e.i. delete/insert, the corner radius is reset back to 0.
I've tried to set the corner radius while editing:
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
guard let cell = tableView.cellForRow(at: indexPath) as? HabitTableViewCell else { return }
cell.layer.cornerRadius = 13
if editingStyle == .delete {
controller.delete(habit: frc.object(at: indexPath))
}
}
I've also tried implementing willBeginEditingRowAt in a similar way to try to get the corner radius to stay set. The last thing I tried was creating a custom UIContextualAction in trailingSwipeActionsConfigurationForRowAt, but it doesn't change anything.
There was a similar question asked about four years ago, but no conclusive solution was ever found. Any help or insight is appreciated!