CodePudding user response:
It was, as tends to be the case, my mistake
After searching a lot I realized the issue.
The problem was mostly we all set the cell's selectionStyle property to .none from Storyboard or programmatically to remove the background color of the cell during the selection.
Keep in mind that if you want to use the default selection or multiple selections feature during the editing must you need to follow this
Set the Selection Style from Storyboard
You can also Set in table views cellForRowAt method
cell.selectionStyle = .none
To remove or change the background color of the cell for the selection you need to use this override method in UITableViewCell
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
self.backgroundColor = selected ? .gray : .white
}


