Question

I have a basic tableview with section headers that contains cells. A cell either has a checkmark visible or not. When the user selects the cell, it toggles the checkmark, and if all items in that section has the checkmark visible, additionally the section header is greyed out.

I trigger the UI update in tableView:didSelectRowAtIndexPath: by first updating the model and then call reloadSections:withRowAnimation:UITableViewRowAnimationAutomatic on the relevant section.

The problem is that when animating the change (duration about 0.3 s), the user cannot select another row until the animation is done. It is a common usage scenario, wanting to check a number of items in batch. I also absolutely want to animate the change.

The documentation states that one can configure a UIAnimation using UIViewAnimationOptionAllowUserInteraction to remedy this, but since I'm not using a manual UIAnimation but only calling UITableViewRowAnimationAutomatic, I don't know how to accomplish this.

Is there a way to allow the user to select (and initiate animations) on other cells while such an animation/reload is ongoing?

Note

It's tricky to get a custom section header to redraw/animate, the only way I managed to do it is by first reloading the affected section, and then immediately reloading the table – the latter to hide a flicker that appears otherwise.

If I only reload the single affected row, there is not animation on the section header – it just changes.

Was it helpful?

Solution

I ended up disregarding that the section header does not animate, the user experience is more severely affected by not being able to quickly toggle several items in the list.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top