Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andr3a88/trydiffabledatasource
Try Combine and DiffableDataSource
https://github.com/andr3a88/trydiffabledatasource
ios swift
Last synced: 7 days ago
JSON representation
Try Combine and DiffableDataSource
- Host: GitHub
- URL: https://github.com/andr3a88/trydiffabledatasource
- Owner: andr3a88
- Created: 2019-10-15T14:50:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T08:32:14.000Z (over 4 years ago)
- Last Synced: 2024-11-07T20:52:45.750Z (about 2 months ago)
- Topics: ios, swift
- Language: Swift
- Size: 35.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TryDiffableDataSource
+ [WWDC 2019 - Advances in UI Data Sources](https://developer.apple.com/videos/play/wwdc2019/220/)
+ [medium.com/@tlimaye91/what-is-diffabledatasource-in-ios13](https://medium.com/@tlimaye91/what-is-diffabledatasource-in-ios13-fcfcf5f27115)iOS 13 bring a whole new way of loading UITableview and UICollectionViews.
**DiffableDataSource** is completely new approach to change your tableview data with all basic operations with less code. Instead of _performbatchupdates_ it has a simple method called **apply**.
**Key concept**
+ Snapshot, truth of UI state, no more indexPaths, unique identifiers for sections and items
+ Identifiers, must be uniquea and conforms to hashable
+ `dataSource.apply()` replace `perfomBatchUpdates()`
+ See `UICollectionViewDiffableDataSource` and `UITableViewDiffableDataSource`**What is a Snapshot???**
It is the current state of the UI. It has unique identifier for sections and items. One of the thing you might like is — It does not have indexPaths.Share sheet on iOS 13 is built on top of *DiffableDataSource*