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's selectionStyle
property to UITableViewCellSelectionStyleNone
. 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.
Old thread but i also had this issue, however i found the cause to be my custom cell was overriding the setSelected and setHighlighted methods without call super.
This resulted in the cells not becoming selectable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With