CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Changes 2.0.1

Changes 2.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2016
SPMSupports SPM

Maintained by Chris Amanse, Chris Amanse.



Changes 2.0.1

Changes

A Swift framework that computes changes occurred in a CollectionType. Elements of the collection should also conform to Equatable. Inspired by Changeset.

Installation

  • Carthage
    • Simply add github "chrisamanse/Changes" ~> 2.0 in your Cartfile

  • CocoaPods
    • Add pod "Changes" in your Podfile

  • Swift Package Manager
    • Add .Package(url: "https://github.com/chrisamanse/Changes.git, majorVersion: 2) in dependencies

  • Manual
    • Add this project as a subproject of your Xcode project
    • Or simply copy the source files

Usage

Change

Get changes of a Collection with elements that conform to Equatable.

let oldArray = [1,2,3,4,5]
let newArray = [1,3,2,4]

// Get changes
let changes = newArray.changes(since: oldArray)

// Prints out ["Moved 3 from index 2 to 1", "Deleted 5 at index 4"]
print(changes)

License

Copyright © 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.