Assertion Failure in UICollectionViewData indexPathForItemAtGlobalIndex

后端 未结 8 2070
南旧
南旧 2020-12-15 04:15

I am using performBatchUpdates() to update my collection view, where I am doing a complete refresh, i.e. delete whatever was in it and re-insert everything.

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 04:41

    If you remove the last cell from a section containing header/footer the bug appears.

    I tried to return nil for header/footer size/element at that time and this sometimes fixes the issue.

    Options:

    1. Reload the whole table view instead of animating the removal of the last item.
    2. Add an additional invisible, basic cell with a size less than 1.

提交回复
热议问题