Yup. I was just opening & closing categories.
The issue with the multiple tableView:deleteRow() calls causing this gap in tableView display is directly caused by the inefficient way tableView:deleteRow() is currently coded. First off it is applying the transition.to off to left to the row being deleted. Not everyone will want their rows to go off to the left, some might prefer transition up, right or just go pooff etc. So I think if I was re-writing the tableView:deleteRow() method I would make the transition style optional & selectable.
Secondly it is going through a rigorous for loop going through all remaining rows of the tableView and moving them up by one. The onScreen rows are moved visually and offscreen ones are moved in terms of indexes. There has to be a better way of doing this. New inserts are handled very nicely with the lazy loading. We need something along the same lines
Lastly, when you call multiple tableView:deleteRow()s in a close progression, this fires off multiple instances of this method running in an asynchronous manner. Since they don’t watch out for each other and yet they use same internal variables you end up getting the gap in the middle issue. If you delay your tableView:deleteRow() calls by as little as 400 milliseconds the issue goes away but deleting rows one after the other with a time delay in between gives you a huge eye-sore.
Anyways, I’m totally on board with Atanas’s suggestion. While we can make do somehow with a makeshift collapse/expand solution for now this would ideally be implemented right inside the widget. To do that the widget also needs to recognize the Category rows and the child rows under them in relation with the category rows a little different than it is now. Right now there is no relationship at all.
While I’m typing I see there are new posts and an updated sample. Thanks much for that. I’ll go and give it a spin and see how it looks now. Appreciate all your insight and input.