I have a grouped UITableView with custom section header views and want to perform add/remove rows animation when user clicks on these header views:
tableView.insertRows(at: rowsToInsertOrDelete, with: .top)
//or
tableView.deleteRows(at: rowsToInsertOrDelete, with: .top)
It should look like "combobox" animation.
The problem is gaps between groups. It seems they contain no UI elements so they are transparent and animation overlaps them (only the first group/section works properly). In the same time custom section header views are above the animation and hide it properly for each section.
How to fix this issue? For example by adding opaque views overlapping these gaps?
I had the same problem — the animation peeks through the groups between sections.
I tried using
.plainstyle with blank footer views. That eliminates the animation glitch, but the footer floats over the cells at the bottom of long scrollable sections, which looks worse.I settled on
.groupedstyle with.middleanimation. It doesn't have that drop-down combobox look I wanted, but the animation is limited to the section where the cells change, which is less distracting than the glitch with.top.