Post

Replies

Boosts

Views

Activity

reloadItems behavior on NSDiffableDataSourceSnapshot
Hi everyone,I cannot figure out how to use reloadItems on a diffable data source snapshot. What I'm trying to do is to change an item and reload it in order to update its corresponding collection view cell. Everything seems to work fine (the snapshot is applied and the cell is reloaded) but the cell keeps its old values. After some investigation I noticed that when using a struct as the item, reloadItems doesn't change the snapshot with the updated values. If I use a class instead, it works as expected. Is this the normal behavior?Look at these 2 examples:- https://gist.github.com/emiliopavia/f9c8a1ee2aa41fc314bfa7e8f9125bb9- https://gist.github.com/emiliopavia/d3a0cdaef648fb782302054d95e5ae9dThe only difference is class vs. struct.Thanks!
10
1
18k
Dec ’19