Latest 0.7.0
Homepage https://github.com/Q42/ElementDiff
License MIT
Platforms ios 8.0, tvos 9.0, requires ARC
Authors

ElementDiff Version
License
Platform


Compute differences between two sequences of elements.

These can be passed to updateSection extensions to animate transitions.

Example

// Update self.items array of view models
let previous: [ViewModel] = self.items
self.items = model.currentViewModels()
let diff = previous.diff(self.items)

// Animate changes to view models array
self.tableView.beginUpdates()
self.tableView.updateSection(0, diff: diff)
self.tableView.endUpdates()

Example

Installation

ElementDiff is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ElementDiff"

Releases

  • 0.7.0 – 2018-10-02 – Swift 4.2 support
  • 0.6.0 – 2018-04-23 – Throw error for non-unique ids
  • 0.5.0 – 2017-06-23 – Add fatalError for non-unique ids
  • 0.4.0 – 2016-12-06 – Swift 3 support
  • 0.3.0 – 2016-09-03 – Remove reloadRowsAtIndexPaths
  • 0.2.1 – 2016-03-04 – Make ElementDiff struct fields vars
  • 0.2.0 – 2015-12-22 – Allow for using custom identifier
  • 0.1.0 – 2015-12-12 – Initial public release
  • 0.0.0 – 2015-07-29 – Initial private version for project at Q42

License & Credits

ElementDiff is written by Tom Lokhorst of Q42 and available under the MIT license, so fee free to use it in commercial and non-commercial projects.

Latest podspec

{
    "name": "ElementDiff",
    "version": "0.7.0",
    "summary": "Animate tableview for view model arrays",
    "description": "Animate UITableView s and UICollectionViews based on changes in view model arrays.",
    "license": "MIT",
    "authors": {
        "Tom Lokhorst": "[email protected]"
    },
    "social_media_url": "https://twitter.com/tomlokhorst",
    "homepage": "https://github.com/Q42/ElementDiff",
    "platforms": {
        "ios": "8.0",
        "tvos": "9.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/Q42/ElementDiff.git",
        "tag": "0.7.0"
    },
    "requires_arc": true,
    "source_files": "Sources/**/*"
}

Pin It on Pinterest

Share This