Latest 0.5.2
Homepage https://github.com/zenangst/Differific
License MIT
Platforms ios 9.0, osx 10.11, tvos 9.2, requires ARC
Authors

CI Status
Version
Carthage Compatible
License
Platform
Swift

Description

Differific Icon

Differific is a diffing tool that helps you compare Hashable objects using the Paul Heckel’s diffing algorithm. Creating a changeset is seamless for all your diffing needs. The library also includes some convenience extensions to make life easier when updating data sources.

The library is based and highly influenced by Matias Cudich’s (@mcudich) HeckelDiff library that aims to solve the same issue. Versions prior to 0.3.0 was based on DeepDiff.
For more information about how the algorithm works and the performance of the algorithm, head over to DeepDiff. For the time being, both frameworks are very similar; this is subject to change when the frameworks evolve.

Features

  • [x] 🍩Built-in extensions for updating table & collection views.
  • [x] 🏎High performance.
  • [x] 📱iOS support.
  • [x] 💻macOS support.
  • [x] 📺tvOS support.

Usage

Diffing two collections

let old = ["Foo", "Bar"]
let new = ["Foo", "Bar", "Baz"]
let manager = DiffManager()
let changes = manager.diff(old, new)

Updating a table or collection view

// uiElement is either your table view or collection view.
let old = dataSource.models
let new = newCollection
let changes = DiffManager().diff(old, new)
uiElement.reload(with: changes, before: { dataSource.models = new })

Installation

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

pod 'Differific'

Differific is also available through Carthage.
To install just write into your Cartfile:

github "zenangst/Differific"

Differific can also be installed manually. Just download and drop Sources folders in your project.

Author

Contributing

We would love you to contribute to Differific, check the CONTRIBUTING file for more info.

License

Differific is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Differific",
    "summary": "A fast and convenient diffing framework",
    "version": "0.5.2",
    "homepage": "https://github.com/zenangst/Differific",
    "license": "MIT",
    "authors": {
        "Christoffer Winterkvist": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zenangst/Differific.git",
        "tag": "0.5.2"
    },
    "social_media_url": "https://twitter.com/zenangst",
    "platforms": {
        "ios": "9.0",
        "osx": "10.11",
        "tvos": "9.2"
    },
    "requires_arc": true,
    "ios": {
        "source_files": "Source/{iOS+tvOS,Shared}/**/*"
    },
    "tvos": {
        "source_files": "Source/{iOS+tvOS,Shared}/**/*"
    },
    "osx": {
        "source_files": "Source/{macOS,Shared}/**/*"
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.2"
    }
}

Pin It on Pinterest

Share This