Open rizwan95 opened 4 years ago
Please, explain. That request is very vague.
Apple introduced Diffable datasources for TableViews and collectionviews from iOS 13 onwards. Instead of UITableViewDataSource, DiffableDatasource can be used. Which means that we should not explicitly call reloadData or performBatch updates. The diffable datasource will take care of things.
So we need support for the developers who use diffable datasourece.
WWDC link : https://developer.apple.com/videos/play/wwdc2019/220
@dzenbot
@rizwan95 UITableViewDiffableDataSource
conforms to UITableViewDataSource
. It's still possible to use. Just call tableView.reloadEmptyDataSet()
after calling apply(snapshot:animatingDifferences:)
and implement emptyDataSetShouldDisplay(_: UIScrollView!)
to check your data models.
@whoyawn : Yes, tableView.reloadEmptyDataSet()
works, but when a diffable data source is used, we are not supposed to call tableView.reloadData() according to Apple. So, does this affect ```
reloadEmptyDataSet()
The comment above reloadEmptyDataSet()
says
/* Reloads the empty dataset content receiver. @discussion Call this method to force all the data to refresh. Calling -reloadData is similar, but this forces only the empty dataset to reload, not the entire table view or collection view. /
So it shouldn't call the reloadData()
nor do any heavy table view related operations at all. @dzenbot Correct me if I'm wrong.
It would be great if the support for diffable datasource is given! @dzenbot