Skip to content

A ArrayDataProvider which calculates a diff when its contents change.

License

Notifications You must be signed in to change notification settings

dbsystel/DiffedArrayDataProvider

Repository files navigation

Build Status Carthage Compatible

DiffedArrayDataProvider

A composable wrapper arround CollectionDataProvider defined in Sourcing which calculates a diff when its content changes. The diff is then used to drive animations inside a Table/CollectioView.

Usage

Elements of your data provider need to implement Hashable

let arrayDataProvider = ArrayDataProvider(rows: [1, 2, 3])
let diffedArrayDataProvider = DiffedArrayDataProvider(dataProvider: arrayDataProvider)

// Use diffedArrayDataProvider 

Requirements

  • iOS 9.3+
  • Xcode 11.0+
  • Swift 5.0

Installation

Swift Package Manager

SPM is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Specify the following in your Package.swift:

.package(url: "https://github.com/dbsystel/DiffedArrayDataProvider", from: "2.0.0"),

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

Specify the following in your Cartfile:

github "dbsystel/DiffedArrayDataProvider" ~> 2.0

Contributing

Feel free to submit a pull request with new features, improvements on tests or documentation and bug fixes. Keep in mind that we welcome code that is well tested and documented.

Contact

Lukas Schmidt (Mail, @lightsprint09)

License

DiffedArrayDataProvider is released under the MIT license. See LICENSE for details.