nsdiffabledatasourcesnapshot

How can I reload items without removing and inserting with UITableViewDiffableDataSource?

若如初见. 提交于 2020-07-09 03:54:32
问题 I'm implementing a search screen in my app using UITableViewDiffableDataSource . Each cell represents a search hit and highlights the search match in the cell title, kind of like Xcode's Open Quickly window highlights portions of its result items. As text is typed into the search field, I update the results list. Results move up and down in the list as their relevance changes. The trick is that I need to force every cell to re-render every time the search text changes, because a new search

How can I reload items without removing and inserting with UITableViewDiffableDataSource?

╄→гoц情女王★ 提交于 2020-07-09 03:52:29
问题 I'm implementing a search screen in my app using UITableViewDiffableDataSource . Each cell represents a search hit and highlights the search match in the cell title, kind of like Xcode's Open Quickly window highlights portions of its result items. As text is typed into the search field, I update the results list. Results move up and down in the list as their relevance changes. The trick is that I need to force every cell to re-render every time the search text changes, because a new search