Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Changeset

Changeset

MITSwiftv3.2.0

A Swift library that computes minimal edits between two collections, primarily for animating UITableView and UICollectionView updates.

GitHubGitHub
801 stars41 forks0 contributors

What is Changeset?

Changeset is a Swift library that calculates the minimal edits required to transform one collection into another. It implements Dave DeLong's edit distance algorithm to detect additions, deletions, substitutions, and moves between two sets of equatable elements, solving the problem of efficiently animating data changes in iOS user interfaces.

Target Audience

iOS developers working with UITableView or UICollectionView who need to animate data updates smoothly and correctly according to Apple's batch update guidelines.

Value Proposition

Developers choose Changeset because it provides a reliable, minimal-edit algorithm specifically designed for UIKit integration, with convenience extensions that simplify animated updates and support custom comparison logic for fine-grained control.

Overview

Minimal edits from one collection to another

Use Cases

Best For

  • Animating UITableView updates when data changes
  • Animating UICollectionView updates with insertions, deletions, and moves
  • Computing differences between two arrays or strings in Swift
  • Implementing custom diff logic for collection transformations
  • Ensuring correct batch update sequences for iOS UI animations
  • Reducing boilerplate code for data-driven UI updates

Not Ideal For

  • Projects built with SwiftUI that rely on its built-in diffing and state management
  • Applications requiring real-time diffing of very large collections with minimal latency overhead
  • Cross-platform development where iOS UIKit integration is not needed or applicable

Pros & Cons

Pros

Minimal Edit Accuracy

Implements Dave DeLong's algorithm to compute the smallest set of changes (additions, deletions, substitutions, moves), ensuring smooth animations, as shown in the 'kitten' to 'sitting' example.

UIKit Convenience Extensions

Provides direct integration with UITableView and UICollectionView through extensions like `tableView.update(with: changeset.edits)`, simplifying animated updates per Apple's batch update guidelines.

Custom Comparators for Control

Allows custom comparison logic, such as always triggering changes for specific elements, enabling fine-grained animation control to prevent unwanted cell updates.

Standalone Edit Calculation

Offers a lightweight `edits` static method to compute edits without creating a full Changeset object, reducing overhead for performance-sensitive scenarios.

Cons

Limited to UIKit Ecosystem

Tightly coupled with UIKit, with no support for SwiftUI or other frameworks, making it obsolete for modern iOS projects adopting declarative UI approaches.

Performance Overhead for Large Collections

Computing minimal edits can be slow for very large datasets, potentially impacting UI responsiveness during frequent updates, as the algorithm scales with collection size.

Complex Customization Setup

While custom comparators are supported, implementing advanced diffing logic requires deep understanding of the algorithm, adding complexity for non-trivial use cases.

Frequently Asked Questions

Quick Stats

Stars801
Forks41
Contributors0
Open Issues2
Last commit5 years ago
CreatedSince 2015

Tags

#ios#diff-algorithm#delta#uitableview#uicollectionview#swift#macos#uikit#diff

Built With

S
Swift

Included in

iOS51.7k
Auto-fetched 19 hours ago

Related Projects

DollarDollar

A functional tool-belt for Swift Language similar to Lo-Dash or Underscore.js in Javascript

Stars4,248
Forks362
Last commit2 years ago
DifferenceKitDifferenceKit

💻 A fast and flexible O(n) difference algorithm framework for Swift collection.

Stars3,659
Forks242
Last commit2 years ago
ResultResult

Swift type modelling the success/failure of arbitrary operations.

Stars2,498
Forks228
Last commit5 years ago
EKAlgorithms contains some well known CS algorithms & data structuresEKAlgorithms contains some well known CS algorithms & data structures

EKAlgorithms contains some well known CS algorithms & data structures.

Stars2,410
Forks355
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub