You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Table reloading failed with exception: Thread 1: "attempt to insert row 0 into section 1, but there are only 0 rows in section 1 after the update"
Steps to Reproduce
Code example:
class Item { ... }
class Group {
var isExpanded = true
var items: [Item] = ...
func visibleItems() -> [Item] { isExpanded ? self.items : [] }
...
}
var groups: [Group] = {
let group = Group()
group.items = Item()
return [group]
}()
Where groups represent sections and items represent rows. Just expand-collapse a section (isExpanded changed), calc the diff and try to reload the table with these data using any method in this library.
Detailed Description (Include Screenshots)
The problem is in your reload method which attempts to reload data step-by-step. In my case it means on expand it attempts to add one Item and insert it into the table immediately ignoring isExpanded value which should be updated in the next run loop.
Reproducible Demo Project
I don't have but it seems the task is trivial to reproduce.
Environments
Doesn't matter because there is an error inside this library algo.
The text was updated successfully, but these errors were encountered:
Checklist
Expected Behavior
Table reloads
Current Behavior
Table reloading failed with exception:
Thread 1: "attempt to insert row 0 into section 1, but there are only 0 rows in section 1 after the update"
Steps to Reproduce
Code example:
Where
groups
represent sections anditems
represent rows. Just expand-collapse a section (isExpanded changed), calc the diff and try to reload the table with these data using any method in this library.Detailed Description (Include Screenshots)
The problem is in your reload method which attempts to reload data step-by-step. In my case it means on expand it attempts to add one
Item
and insert it into the table immediately ignoringisExpanded
value which should be updated in the next run loop.Reproducible Demo Project
I don't have but it seems the task is trivial to reproduce.
Environments
Doesn't matter because there is an error inside this library algo.
The text was updated successfully, but these errors were encountered: