I have a UITableView that is configured to allow multiple cells to be selected in edit mode. However, the empty white circles on the left never change to red circles with the white checkmarks inside after a cell is touched/selected.
I have read about the swipe to delete issue with allowsMultipleSelectionDuringEditing, so my setEditing:animinated method looks like this:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
self.tableView.allowsMultipleSelectionDuringEditing = editing;
[super setEditing:editing animated:animated];
}
Some resources on the Net suggest setting allowsSelectionDuringEditing = NO;, but that has no effect. Also, my cell editing style is set to UITableViewCellEditingStyleDelete, and changing it does not have any effect either.
When a row is touched in edit mode, tableView:didSelectRowForIndexpath: is triggered, but as mentioned above, the UI does not reflect this.
It was, as tends to be the case, my mistake.
The problem was in my implementation of
tableView:cellForRowAtIndexPath:, where I was setting the cell’sselectionStyleproperty toUITableViewCellSelectionStyleNone. For some reason, this has the added ‘benefit’ of disabling the red checkmark on the left hand side in multiselection edit mode.Setting
cell.selectionStyle = UITableViewCellSelectionStyleGray;fixed the issue.