scribd / LiveCollections

Automatically perform UITableView and UICollectionView animations between two sets of immutable data. It supports generic data types and is fully thread-safe.
MIT License
341 stars 14 forks source link

Does diffable render this code obsolete? could it be updated to support diffable? #3

Closed 8secz-johndpope closed 3 years ago

StephaneMagne commented 3 years ago

Hi John, thanks for your interest and feedback.

I think that Diffable fills a similar space but in the SwiftUI world. Anyone planning to develop entirely in SwiftUI would probably be best served by adopting the DiffableDataSources that Apple provides, right away.

LiveCollections is wholly designed to support apps that are using (and plan to continue using) UIKit and the standard interfaces for UITableView and UICollectionView.

Additionally, one area I feel that LiveCollections offers a more powerful interface than Diffable is in its simplicity of interface. Once your data classes have adopted the required protocols, you simply need to call collectionData.update(newData), whereas Diffable still (as of this comment) requires to supply additional details with every update.

8secz-johndpope commented 3 years ago

Fyi - the reload of data when animating differences is known by Apple to be hard to get right. Frequent cause of crashes. I'm on a quest to remove any code that references reloadData due to this. https://developer.apple.com/videos/play/wwdc2019/220

I haven't touched SwiftUI - probably give it a whirl when ios15 hits.