Skip to content
CAI
Software that uses CAICheck a score

ra1028/DifferenceKit

64.5

Adequate · 30 September 2026

2.4k

lines of production code

Swift

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

DifferenceKit is a Swift library designed to calculate diffs for ordered collections and apply those changes as animated updates to UI components in iOS, macOS, tvOS, and watchOS applications. It provides a staged changeset algorithm that safely handles complex batch operations like inserts, deletes, and moves, preventing common animation glitches and crashes. The system includes comprehensive tooling such as performance benchmarks against other diffing libraries, interactive playgrounds, and example apps to demonstrate integration with UIKit and AppKit.

Features

Add Swift ordered collection diffing benchmark project

A new Xcode project and workspace have been added to the Benchmark directory to evaluate Swift ordered collection diffing libraries. The project integrates several third-party frameworks via CocoaPods, including DifferenceKit, Differentiator, FlexibleDiff, IGListKit, DeepDiff, Differ, and Dwifft, allowing developers to compare the performance of these diffing algorithms.

Benchmark/Benchmark.xcodeproj · high confidence

Add iOS example app demonstrating DifferenceKit usage

The iOS example application has been added to provide a practical demonstration of the DifferenceKit library. The app includes a home screen with navigation to three distinct demos: a 'Shuffle Emoticon' view using UICollectionView to show sectioned emoji shuffling, a 'Header Footer Section' view using UITableView to demonstrate header and footer updates via section reloading, and a 'Random' view that generates random diff operations on a UICollectionView to showcase insertions, deletions, moves, and updates. The example project is configured to embed the DifferenceKit framework and includes common utilities for reusable views and nib loading.

Examples/Example-iOS · high confidence

Add macOS example app demonstrating DifferenceKit integration

A new macOS example project has been added to showcase the DifferenceKit library. The app features a user interface with a collection view and a table view that display a list of emoticons. When the user clicks a shuffle button, the app uses DifferenceKit to calculate changes and apply animated updates to both views simultaneously, demonstrating how to integrate the library into a native macOS application.

Examples/Example-macOS · high confidence

Add staged batch update extensions for AppKit and UIKit collection views

New extension methods have been added to NSTableView, NSCollectionView, UITableView, and UICollectionView to apply multiple animated updates in stages using StagedChangeset. This allows developers to perform complex batch updates (inserts, deletes, moves, and reloads) while avoiding crashes that can occur with simultaneous changes in standard performBatchUpdates calls. The implementation includes an interrupt callback to fall back to reloadData if a specific changeset causes issues, and ensures data-source updates are applied synchronously before each animation stage.

Sources/Extensions · high confidence

Added DifferenceKit interactive playground

A new playground has been added to demonstrate the DifferenceKit library. It includes a TableViewController that utilizes StagedChangeset to perform animated table reloads (with fade effects) when switching between two predefined data sets, allowing users to visually verify diffing and animation behavior.

DifferenceKit.playground · high confidence

Added Swift collection diffing benchmark

A new benchmark suite has been added to the project to measure the performance of various Swift collection diffing libraries. The benchmark, located in Benchmark/Sources, compares the execution time of DifferenceKit, RxDataSources, IGListKit, FlexibleDiff, DeepDiff, Differ, Dwifft, and the native Swift.CollectionDifference API. It evaluates these libraries by calculating diffs on arrays of UUIDs with specified ranges for deletions, insertions, and shuffles, running at two different data scales (5,000 and 100,000 elements).

Benchmark/Sources · high confidence

Added playground to the workspace

The DifferenceKit workspace now includes a reference to the DifferenceKit playground, allowing users to open and interact with the playground directly from the workspace environment.

DifferenceKit.xcworkspace · high confidence

New tvOS example app demonstrating DifferenceKit with UICollectionView

A new tvOS example application has been added to showcase the DifferenceKit library. The app features a UICollectionView displaying emoji cells and demonstrates key library capabilities, including section and item shuffling, and item removal, by leveraging the StagedChangeset API for efficient view updates. It also includes tvOS-specific UI assets and focus management behaviors.

Examples/Example-tvOS · high confidence

Project initialization and infrastructure setup

This change establishes the initial project structure for DifferenceKit, introducing Swift Package Manager support via [e-mail redacted] and configuring CI/CD pipelines with .travis.yml, .hound.yml, and a Makefile. It also adds developer tooling configurations including .swiftlint.yml, .jazzy.yaml for documentation generation, and .swift-mod.yml for code formatting. The repository includes standard documentation files (README.md, CONTRIBUTING.md, CODE\_OF\_CONDUCT.md), a Linux testing script (test-linux.sh), and updates the license from MIT to Apache 2.0.

(repo-wide) · high confidence

Behavioural changes

Apple Silicon support and platform expansion for DifferenceKit

The DifferenceKit configuration has been updated to support Apple Silicon (ARM64) across macOS, iOS, tvOS, and watchOS simulators and devices, and now includes explicit support for the watchOS platform. The configuration directory was also renamed from Configurations to XCConfigs.

XCConfigs · high confidence

DifferenceKit project restructured with new protocols and platform extensions

The DifferenceKit project has been reorganized to support a broader range of platforms and data structures. The source tree now includes new \ContentEquatable\ and \ContentIdentifiable\ protocols, alongside \UIKitExtension.swift\ and \AppKitExtension.swift\ files, enabling usage in both iOS and macOS environments. The core \Section\ type has been renamed to \ArraySection\, and the project structure has been cleaned up with dedicated \Sources\, \Tests\, and \Extensions\ groups. Additionally, the test bundle has been renamed from \DifferenceKitTests\ to \Tests\, and the configuration directory has been renamed to \XCConfigs\.

DifferenceKit.xcodeproj · high confidence

Refactored diffing protocol and staged changeset behavior

The library introduces new \ContentEquatable\ and \ContentIdentifiable\ protocols, replacing the previous \Differentiable\ requirements with a more granular approach to identity and equality checks. The \Section\ type has been renamed to \ArraySection\, and the \AnyDifferentiable\ type-eraser has been updated to use the new content-equality logic. Crucially, the \StagedChangeset\ algorithm has been restructured to separate element updates, deletions, and insertions into distinct stages (updates first, then deletions, then insertions/moves), which resolves animation glitches that occurred when applying simultaneous updates and deletions. The \Changeset\ API also now exposes separate counts for section and element changes.

Sources · high confidence

Removal of Differentiable and DifferentiableSection protocols

The public API surface of DifferenceKit has been reduced by removing the \Differentiable\ and \DifferentiableSection\ protocols. Users can no longer conform to these specific protocols to define difference identifiers or section models; the library now relies on alternative mechanisms for determining updates and structuring sections.

DifferenceKit · high confidence

Test coverage

Migrate tests to Swift 4.2 and add Linux test manifests

The test suite has been migrated to Swift 4.2, removing the manual \allCases\ implementation from the \D\ enum in favor of the standard \CaseIterable\ protocol. A new \ContentEquatableTestCase\ has been added to verify content equality for both regular and optional values. Additionally, \XCTestManifests.swift\ has been generated to support Linux testing, and various test files have been renamed and updated to reflect API changes such as \Section\ becoming \ArraySection\ and \changesCount\ being split into \sectionChangeCount\ and \elementChangeCount\.

Tests · high confidence

Dependencies

Add Swift Package Manager support and update CocoaPods specification

The library now supports installation via Swift Package Manager (SPM) through a new Package.swift file, enabling usage in Swift 4.2 and 5.0 projects on iOS 9+, macOS 10.10+, tvOS 9+, and watchOS 2+. The CocoaPods podspec has been updated to version 1.3.0, adding support for macOS and watchOS platforms and configuring the appropriate deployment targets. Additionally, a new benchmarking environment has been introduced in the Benchmark directory, pinning CocoaPods to version 1.8.4 and including several diffing libraries for performance comparison.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 63 → 64 (+1.4)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 100 → 94 (-5.4)
  • Architecture 94 → 99 (+4.5)
  • Maturity 49 → 49 (+0.0)
  • Readiness 58 → 60 (+2.4)
  • Security 86 → 92 (+5.5)
  • Performance 100 (new)

New (10)

  • Algorithm.swift.diff (cognitive 31) (Sources/Algorithm.swift)
  • Algorithm.swift.diff (cyclomatic 19) (Sources/Algorithm.swift)
  • Duplicated block (13 lines × 4) (Sources/Extensions/AppKitExtension.swift)
  • Duplicated block (6 lines × 3) (Examples/Example-iOS/Sources/Random/RandomViewController.swift)
  • FileTooLong: js/typeahead.jquery.js (docs/js/typeahead.jquery.js)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (Sources/Extensions/AppKitExtension.swift)
  • NSTableView.reload (cognitive 18) (Sources/Extensions/AppKitExtension.swift)
  • Outdated: swift-mod
  • UICollectionView.reload (cognitive 23) (Sources/Extensions/UIKitExtension.swift)
  • UITableView.reload (cognitive 23) (Sources/Extensions/UIKitExtension.swift)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ra1028/DifferenceKit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 02ca1968b10305d4d6771f4005a7ce2c507a8539 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.