maxsokolov / TableKit

Type-safe declarative table views.
MIT License
706 stars 74 forks source link

Remove/delete a section #90

Closed SoriUR closed 5 years ago

SoriUR commented 5 years ago

Hello, there I think i've faced some strange(at least as for me) behavior managing sections. "Insert", "append", "replace" work perfectly, but "remove" and "delete" are different. It seems like user has to call "tableDirector.reload()" explicitly after calling "remove" or "delete" otherwise no changes are applied to the table. I find it uncleare, that only these to functions require explicit reload, and unfortunatly no desctiption is attached to functions for clarification.

maxsokolov commented 5 years ago

Hey @SoriUR

I have to admit, it's unclear with current documentation. If you delete sections/rows you also have to delete them from tableview itself:

tableDirector.delete(sectionAt: 0)
tableView.beginUpdates()
tableView.deleteSections(/*...*/)
tableView.endUpdates() 

tableView.reloadData() also works.