0

When you have a NSDiffableDataSourceSnapshot you can perform a reload on any section/item. NSDiffableDataSourceSnapshot

Whereas when you have a NSDiffableDataSourceSectionSnapshot I can't do any reload.

NSDiffableDataSourceSectionSnapshot

I would like to refresh a specific item because after creating the snapshot I need to trigger the reload via collapsing the section and then expanding it again in order to my cell registration set the cell properly with the updated tag.

Godfather
  • 4,040
  • 6
  • 43
  • 70

1 Answers1

0

In my opinion, collapsing and expanding an item which own child items doesn't produce a refresh of cells. With value type data (struct, not class), to refresh a parent item, you need to delete and insert the parent, then recreate the child. To refresh a child, simply delete and insert a value which contains a modification of the index data for the snapshot. If the modification doesn't change the index, the cell won't be refreshed.

Bgr
  • 1
  • 2