Latest 2.0.1
Homepage https://github.com/chrisamanse/Changes
License MIT
Platforms ios 9.0, osx 10.10, watchos 2.0, tvos 10, requires ARC
Authors

Build Status
Swift Version
spm compatible
Carthage compatible
CocoaPods compatible
Platform

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 (c) 2016 Joe Christopher Paul Amanse

This software is distributed under the MIT License.

Latest podspec

{
    "name": "Changes",
    "version": "2.0.1",
    "summary": "A Swift framework that computes changes occurred in a `Collection`",
    "description": "A Swift framework that computes changes occurred in a `Collection`. Elements of the collection should conform to `Equatable`.",
    "homepage": "https://github.com/chrisamanse/Changes",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Amanse": "[email protected]"
    },
    "social_media_url": "http://twitter.com/ChrisAmanse",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "10"
    },
    "source": {
        "git": "https://github.com/chrisamanse/Changes.git",
        "tag": "2.0.1"
    },
    "source_files": [
        "Sources",
        "Sources/**/*.{h,swift}"
    ],
    "requires_arc": true,
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3.0"
    }
}

Pin It on Pinterest

Share This