ArrayDiff alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view ArrayDiff alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 500 native Swift extensions to boost your productivity. -
SwiftGen-Storyboard
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
SwiftGen
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
R.swift
Strong typed, autocompleted resources like images, fonts and segues in Swift projects -
Dollar
A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
EZSwiftExtensions
:smirk: How Swift standard types and classes were supposed to work. -
DifferenceKit
💻 A fast and flexible O(n) difference algorithm framework for Swift collection. -
Result
Swift type modelling the success/failure of arbitrary operations. -
DeepDiff
🦀Amazingly incredible extraordinary lightning fast diffing in Swift -
Device
Light weight tool for detecting the current device and screen size written in swift. -
SwiftLinkPreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images. -
WhatsNew
Showcase new features after an app update similar to Pages, Numbers and Keynote. -
Codextended
Extensions giving Swift's Codable API type inference super powers 🦸♂️🦹♀️ -
Popsicle
Delightful, extensible Swift value interpolation framework. -
SwiftyJSONAccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable) -
Playbook
📘A library for isolated developing UI components and automatically taking snapshots of them. -
ReadabilityKit
Preview extractor for news, articles and full-texts in Swift -
ObjectiveKit
Swift-friendly API for a set of powerful Objective C runtime functions. -
Compass
:earth_africa: Compass helps you setup a central navigation system for your application -
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift -
Pythonic.swift
Pythonic tool-belt for Swift – a Swift implementation of selected parts of Python standard library. -
BetterSafariView
A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI. -
SwiftPlantUML
A command-line tool and Swift Package for generating class diagrams powered by PlantUML
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ArrayDiff or a related project?
README
ArrayDiff

An efficient Swift utility to compute the difference between two arrays. Get the removedIndexes
and insertedIndexes
and pass them directly along to UITableView
or UICollectionView
when you update your data! The diffing algorithm is the same that powers the diff
utility – it's robust and quick.
Basic Example
let old = [ "a", "b", "c", "d" ]
let new = [ "a", "c", "e", "f", "d" ]
let diff = old.diff(new)
// diff.removedIndexes = { 1 }
// diff.insertedIndexes = { 2, 3 }
// To update rows in section 0:
tableView.beginUpdates()
self.data = new
diff.applyToRowsInTableView(tableView, section: 0, rowAnimation: .Automatic)
tableView.endUpdates()
// Or to update sections:
tableView.beginUpdates()
self.data = new
diff.applyToSectionsInTableView(tableView, rowAnimation: .Automatic)
tableView.endUpdates()
Nested Diff
You can use types that conform to SectionType
to perform nested row- and section-level diffs simultaneously:
let old = [
BasicSection(name: "Alpha", items: ["a", "b", "c", "d", "e"]),
BasicSection(name: "Bravo", items: ["f", "g", "h", "i", "j"]),
BasicSection(name: "Charlie", items: ["k", "l", "m", "n", "o"])
]
let new = [
BasicSection(name: "Alpha", items: ["a", "b", "d", "e", "x"]),
BasicSection(name: "Charlie", items: ["f", "g", "h", "i", "j"]),
BasicSection(name: "Delta", items: ["f", "g", "h", "i", "j"])
]
let nestedDiff = old.diffNested(new)
// nestedDiff.sectionsDiff.removedIndexes == {1}
// nestedDiff.sectionsDiff.insertedIndexes == {2}
// nestedDiff.itemDiffs[0].removedIndexes == {2}
// nestedDiff.itemDiffs[0].insertedIndexes == {5}
// etc.
tableView.beginUpdates()
self.data = new
nestedDiff.applyToTableView(tableView, rowAnimation: .Automatic)
tableView.endUpdates()
Limitations
Item moves are treated as remove/insert, so when they are animated the cell will "teleport" to its new position, rather than sliding there. If you would like this feature, let me know in the Issues!
Example Project
Check out the iOS app in the Example folder to see this framework pushed to its limits to drive a UITableView. In it we have a table view with 20 sections of strings. When you tap update, the data is randomly updated and we assert that the changes we made are equal to the changes that the framework recovers by comparing the two arrays.
Attribution
Thanks to https://github.com/khanlou/NSArray-LongestCommonSubsequence which I took inspiration totally copied from.