RxSwiftCommunity/RxDataSources
UITableView and UICollectionView Data Sources for RxSwift (sections, animated updates, editing ...)
Healthy across all four use cases
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓27+ active contributors
- ✓Distributed ownership (top contributor 30% of recent commits)
- ✓MIT licensed
Show 3 more →Show less
- ✓CI configured
- ✓Tests present
- ⚠Stale — last commit 2y ago
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/rxswiftcommunity/rxdatasources)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/rxswiftcommunity/rxdatasources on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: RxSwiftCommunity/RxDataSources
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/RxSwiftCommunity/RxDataSources shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across all four use cases
- 27+ active contributors
- Distributed ownership (top contributor 30% of recent commits)
- MIT licensed
- CI configured
- Tests present
- ⚠ Stale — last commit 2y ago
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live RxSwiftCommunity/RxDataSources
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/RxSwiftCommunity/RxDataSources.
What it runs against: a local clone of RxSwiftCommunity/RxDataSources — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in RxSwiftCommunity/RxDataSources | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 699 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of RxSwiftCommunity/RxDataSources. If you don't
# have one yet, run these first:
#
# git clone https://github.com/RxSwiftCommunity/RxDataSources.git
# cd RxDataSources
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of RxSwiftCommunity/RxDataSources and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "RxSwiftCommunity/RxDataSources(\\.git)?\\b" \\
&& ok "origin remote is RxSwiftCommunity/RxDataSources" \\
|| miss "origin remote is not RxSwiftCommunity/RxDataSources (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "Sources/Differentiator/Diff.swift" \\
&& ok "Sources/Differentiator/Diff.swift" \\
|| miss "missing critical file: Sources/Differentiator/Diff.swift"
test -f "Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift" \\
&& ok "Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift" \\
|| miss "missing critical file: Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift"
test -f "Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift" \\
&& ok "Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift" \\
|| miss "missing critical file: Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift"
test -f "Sources/Differentiator/AnimatableSectionModelType.swift" \\
&& ok "Sources/Differentiator/AnimatableSectionModelType.swift" \\
|| miss "missing critical file: Sources/Differentiator/AnimatableSectionModelType.swift"
test -f "Sources/Differentiator/IdentifiableType.swift" \\
&& ok "Sources/Differentiator/IdentifiableType.swift" \\
|| miss "missing critical file: Sources/Differentiator/IdentifiableType.swift"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 699 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~669d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/RxSwiftCommunity/RxDataSources"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
RxDataSources is a Swift library that provides reactive UITableView and UICollectionView data sources with automatic diff calculation and animated updates. It implements an O(N) diffing algorithm to compute the minimal set of insert/delete/move/reload operations when your data changes, eliminating the tedium of implementing multiple UITableViewDataSource/UICollectionViewDataSource delegate methods while handling complex multi-section scenarios with animations. Dual-structure: core library code in the root sources/ directory implements RxTableViewSectionedReloadDataSource and RxCollectionViewSectionedReloadDataSource, with Differentiator.podspec defining the diffing engine; Examples/Example contains a full-featured iOS app demonstrating all features (tableview editing, section animations, mixed cell types). Package.swift and RxDataSources.podspec declare the same sources for SPM and CocoaPods respectively.
👥Who it's for
iOS developers using RxSwift who need to bind observable sequences to table or collection views with multiple sections, animated updates, and editing capabilities—particularly those building data-heavy UIs where manual diff calculation and animation orchestration would be error-prone.
🌱Maturity & risk
Actively maintained and production-ready. The repo has Travis CI configured (.travis.yml), comprehensive examples in Examples/, randomized stress tests, and supports both CocoaPods (RxDataSources.podspec) and SPM (Package.swift). The presence of CHANGELOG.md, semantic versioning via podspec, and multiple example implementations (Example1_CustomizationUsingTableViewDelegate.swift through Example5_UIPickerView.swift) indicate mature stewardship.
Low risk for a stable library, though dependency on RxSwift itself (a reactive framework that requires paradigm shift) means consumer code complexity; the repo is part of RxSwiftCommunity (not core RxSwift) so maintenance depends on community volunteers rather than a corporate sponsor. The codebase is primarily Swift (135KB) with minimal Objective-C (1KB), reducing legacy technical debt.
Active areas of work
The repo shows active maintenance with CI/CD via .travis.yml, though specific recent PR or issue data is not visible in the file listing provided. The presence of Package.resolved suggests recent SPM dependency updates, and the comprehensive examples suggest ongoing feature stability rather than active feature development.
🚀Get running
Clone and set up: git clone https://github.com/RxSwiftCommunity/RxDataSources.git && cd RxDataSources. For the example app: open Examples/Example.xcodeproj and run on Xcode (requires Xcode 12+, Swift 5.0+). For package integration: add to Package.swift as .package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", .upToNextMajor(from: "5.0.0")) or use CocoaPods: pod 'RxDataSources'.
Daily commands: Open Examples/Example.xcodeproj in Xcode and press Cmd+R to run the example app. It includes five interactive examples: custom delegate usage, randomized section animations, table editing, mixed cell types, and UIPickerView integration. No server setup required; all data is in-memory.
🗺️Map of the codebase
Sources/Differentiator/Diff.swift— Core O(N) diffing algorithm that calculates section and item changes; foundation for all animated updates in the library.Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift— Primary entry point for reactive table view data binding with animated section/item insertions, deletions, and moves.Sources/RxDataSources/RxCollectionViewSectionedAnimatedDataSource.swift— Parallel collection view data source that applies the same diffing and animation logic as table views.Sources/Differentiator/AnimatableSectionModelType.swift— Protocol defining how sections must implement identity and equality for diffing; required by all custom section models.Sources/Differentiator/IdentifiableType.swift— Protocol for uniquely identifying items and sections; essential for the diffing algorithm to work correctly.Sources/Differentiator/Changeset.swift— Data structure representing all calculated changes (insertions, deletions, moves) from diff operation.Sources/RxDataSources/AnimationConfiguration.swift— Controls animation behavior and parameters when applying changesets to UITableView and UICollectionView.
🛠️How to make changes
Add a custom animatable section model
- Create a struct conforming to AnimatableSectionModelType with identity and items (
Sources/Differentiator/AnimatableSectionModelType.swift) - Implement IdentifiableType on your item type for unique identification (
Sources/Differentiator/IdentifiableType.swift) - Use your section model with RxTableViewSectionedAnimatedDataSource or RxCollectionViewSectionedAnimatedDataSource (
Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift) - Configure animation behavior via AnimationConfiguration if needed (
Sources/RxDataSources/AnimationConfiguration.swift)
Implement animated table view binding from an observable
- Create a RxTableViewSectionedAnimatedDataSource with configurationCellForIndexPath and titleForHeaderInSection closures (
Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift) - Optionally set canEditRowAtIndexPath, canMoveRowAtIndexPath for editing support (
Sources/RxDataSources/RxTableViewSectionedAnimatedDataSource.swift) - Bind your observable of section models to tableView.rx.items(dataSource:) operator (
Examples/Example/Example2_RandomizedSectionsAnimation.swift) - Monitor animations via AnimationConfiguration to customize timing and transition styles (
Sources/RxDataSources/AnimationConfiguration.swift)
Add support for a new primitive type as identifiable items
- Create a new file following the pattern of String+IdentifiableType.swift (
Sources/RxDataSources/String+IdentifiableType.swift) - Extend your type conforming to IdentifiableType with identity property returning self (
Sources/Differentiator/IdentifiableType.swift) - Ensure Equatable conformance (built-in for most Swift primitives) (
Sources/RxDataSources/IntegerType+IdentifiableType.swift)
Integrate custom diffing or change monitoring
- Understand the Changeset structure representing all calculated differences (
Sources/Differentiator/Changeset.swift) - Hook into the diffing result via AnimationConfiguration or data source delegate callbacks (
Sources/RxDataSources/AnimationConfiguration.swift) - Use ItemPath utilities to map between index paths and logical model paths (
Sources/Differentiator/ItemPath.swift)
🔧Why these technologies
- RxSwift — Provides reactive stream composition for binding observable data sequences to UI without manual state management
- Swift Protocols (IdentifiableType, AnimatableSectionModelType) — Enables extensibility allowing developers to adapt their existing models without breaking changes or subclassing
- O(N) Myers Diff Algorithm — Guarantees linear performance for calculating minimal changes even with large datasets, critical for smooth animations
- UITableView/UICollectionView performBatchUpdates — Native API for atomic, animated section and item updates that prevents flashing and inconsistent state
⚖️Trade-offs already made
-
O(N) diff algorithm with ambiguity fallback to full reload
- Why: Provides near-optimal performance in typical use cases while avoiding incorrect animations when items lack unique identity
- Consequence: Developers must implement IdentifiableType correctly; ambiguous data (duplicate identities) silently degrades to non-animated reload
-
Separate animated and reload-only data sources (RxTableViewSectionedAnimatedDataSource vs RxTableViewSectionedReloadDataSource)
- Why: Animated source has performance overhead from diffing; reload source is lighter for simple use cases
- Consequence: Developers must choose correct data source type; incorrect choice leads to either unnecessary overhead or lost animations
-
Two-level hierarchy (sections + items only, no nested groups)
- Why: Simplifies diffing algorithm and covers 95% of real-world table/collection view use cases
- Consequence: Cannot represent deeply nested data structures; complex hierarchies must be flattened or handled outside the library
-
Heuristic capping of commands to small number before fallback reload
- Why: Prevents pathological animation sequences (e.g., 1000 individual item inserts) which would freeze the UI
- Consequence: Very large changesets automatically demote to non-animated reload; no way to force detailed animations on huge changes
🚫Non-goals (don't propose these)
- Does not support nested collection structures beyond two-level hierarchy (sections and items)
- Does not handle custom edit/delete swipe actions
🪤Traps & gotchas
RxSwift dependency required—ensure RxSwift is already integrated into your project; mismatched versions can break bindings. AnimatableSectionModelType and IdentifiableType protocols are mandatory—if your model doesn't conform, data binding will fail silently at runtime. The diffing algorithm assumes all sections and items are unique (no duplicates); ambiguous data automatically falls back to non-animated reloads, which may surprise users. UITableViewRowAnimation and UICollectionViewLayoutAttributes must match your data model's change type or animations will appear jerky. The Example app uses Storyboards (Base.lproj/Main.storyboard); if modifying, ensure outlet connections aren't broken.
🏗️Architecture
💡Concepts to learn
- Diff Algorithm (O(N) change computation) — RxDataSources' core value proposition—instead of manually tracking inserts/deletes/moves, it automatically computes the minimal change set to animate from old to new state; understanding how this works (likely via longest-common-subsequence or edit-distance variants) is essential to knowing when and why animations fail or fallback to reloads.
- IdentifiableType Protocol (Swift) — Custom Swift protocol binding items to stable identities so the diff algorithm can track which item moved/changed across updates; without stable IDs, the algorithm cannot disambiguate and falls back to non-animated reload.
- AnimatableSectionModelType Protocol (Swift) — Similar to IdentifiableType but for section models—allows sections themselves to be diffed, enabling insert/delete/move section animations independently of item animations.
- Two-level Hierarchical Animation — RxDataSources applies independent section (insert/delete/move) and item (insert/delete/move/reload) animations simultaneously; knowing this hierarchy prevents confusion when both section and item changes occur together.
- Reactive Data Binding (Observable → UIView) — Core RxSwift pattern used throughout; Observable sequences emit new data states, and RxDataSources subscribes to bind those states to UITableView/UICollectionView, eliminating delegate boilerplate.
- Configurable UITableViewRowAnimation (Fade, Push, Slide, etc.) — RxDataSources allows per-operation animation type (Insert: Fade, Delete: Push, Reload: Automatic); mismatched animation types can reveal diff algorithm errors or data model inconsistencies.
- Ambiguity Fallback Strategy — When the diff algorithm detects ambiguous data (duplicate items/sections), it automatically reverts to non-animated full reload; recognizing when this occurs is critical for debugging unexpected animation loss.
🔗Related repos
ReactiveX/RxSwift— Core reactive framework RxDataSources depends on; provides Observable, Subject, and disposable primitives.RxSwiftCommunity/RxSwift-Texture— Companion library providing async/concurrent data source support for texture (AsyncDisplayKit) layouts, extending RxDataSources concepts to node-based UIs.ra1028/DifferenceKit— Alternative diffing library for UICollectionView/UITableView with similar O(N) algorithm but non-reactive API; useful comparison for understanding diff strategies.airbnb/MvRx— Modern state management pattern for Android that parallels RxDataSources' goals of reducing boilerplate in list UIs through reactivity.RxSwiftCommunity/RxViewController— Companion library providing RxSwift extensions for UIViewController lifecycle, often used alongside RxDataSources for complete reactive ViewController binding.
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add unit tests for Differentiator diff algorithm edge cases
The Differentiator module (Sources/Differentiator/Diff.swift) implements the O(N) diffing algorithm that is core to RxDataSources' value proposition. There's no visible test file for Diff.swift in the file structure. Edge cases like empty changesets, identical sections, duplicate identifiers, and the fallback heuristics mentioned in the README should have comprehensive test coverage to prevent regressions in this critical algorithm.
- [ ] Create Tests/Differentiator/DiffTests.swift with test cases for empty datasets, identical sections, and duplicate item identifiers
- [ ] Add tests for the heuristic that caps changes to small numbers and falls back to reload
- [ ] Add performance benchmarks comparing O(N) vs worst-case fallback behavior
- [ ] Document expected behavior in comments referencing the README's algorithm assumptions
Migrate from Travis CI to GitHub Actions and update CI badge
The README still references Travis CI (.travis.yml exists), but Travis has limitations and GitHub Actions is now standard for GitHub-hosted projects. The repo should have a modern GitHub Actions workflow. This provides better integration, free CI minutes for public repos, and clearer test reporting. Update the badge in README.md to reflect the new CI.
- [ ] Create .github/workflows/ci.yml with jobs for Swift testing, SwiftLint validation, and example app builds across macOS versions
- [ ] Verify the workflow tests all three schemes (Differentiator, RxDataSources, Tests) from the .xcodeproj
- [ ] Update the README.md badge from Travis CI to GitHub Actions with correct workflow/badge syntax
- [ ] Consider deprecating .travis.yml or document the legacy status
Add integration tests demonstrating animated UITableView and UICollectionView updates
The Examples directory has 5 example files, but there are no automated integration tests validating that animated section/item insertions, deletions, and moves actually work correctly on real UITableView/UICollectionView instances. The ExampleUITests/ExampleUITests.swift file is empty. Add snapshot or behavioral tests to verify the Examples work and that data source changes produce correct table/collection view animations.
- [ ] Implement UITests in Examples/ExampleUITests/ExampleUITests.swift covering Example2_RandomizedSectionsAnimation and Example3_TableViewEditing
- [ ] Use XCTest assertions to verify UITableView.numberOfRows, numberOfSections, and cell visibility after animated changeset application
- [ ] Add tests validating that moves (not just inserts/deletes) are applied correctly for reordered items
- [ ] Document any platform-specific animation behavior (iOS 13+) in test comments
🌿Good first issues
- Add unit tests for Differentiator.podspec diffing algorithm edge cases (e.g., all items deleted, all items inserted, cycles of moves). Tests directory is absent in the file listing, suggesting test coverage gaps.
- Document the difference between RxTableViewSectionedReloadDataSource and RxTableViewSectionedAnimatedDataSource (if both exist) in the README—the file structure doesn't clarify which variant to use for different scenarios.
- Create an Example6_CollectionViewAnimations.swift mirroring Example2_RandomizedSectionsAnimation.swift for UICollectionView, since Examples only list five examples and CollectionView support is mentioned in README but less demonstrated.
⭐Top contributors
Click to expand
Top contributors
- @kzaher — 30 commits
- @devxoul — 16 commits
- [@Mikhail Markin](https://github.com/Mikhail Markin) — 6 commits
- @freak4pc — 5 commits
- @AlexShubin — 5 commits
📝Recent commits
Click to expand
Recent commits
bbfea38— Merge pull request #407 from Fleuronic/fix-typo (ElonPark)6b924aa— Fix typo in changelog (jordanekay)f671317— Merge pull request #404 from team-supercharge/spm-dynamic-support (engali94)78253c8— feat: add dynamic spm library support (Barczi Bálint)a655726— Update README.md (#395) (mgopsill)90c29b4— fix: Travis CI build failed for tvOS (ElonPark)a5ea349— Fix iOS, tvOS Deployment target (ElonPark)e4627ac— chore: fix xcodeproj builds by not using SwiftPM linking (thedavidharris)98ae6d9— chore: fix Carthage submodule structure and SPM xcodeproj structure (thedavidharris)241c62e— Switch to main (freak4pc)
🔒Security observations
RxDataSources is a well-structured open-source library with a strong security posture. The codebase shows no critical vulnerabilities such as SQL injection, XSS, hardcoded credentials, or dangerous unvalidated inputs. The project uses standard iOS/Swift development practices. Minor recommendations include reviewing CI/CD configuration for exposed secrets and documenting security best practices for library consumers. The library itself focuses on data presentation rather than sensitive operations, which reduces attack surface.
- Medium · Travis CI Configuration Exposure —
.travis.yml. The .travis.yml file is present in the repository and may contain sensitive build configuration or secrets. Travis CI configuration files can potentially expose environment variables, API keys, or other sensitive data if not properly secured. Fix: Review .travis.yml for any hardcoded secrets. Use Travis CI's encrypted environment variables feature for sensitive data. Consider using GitHub Actions with encrypted secrets instead for better security. - Low · Missing Security Configuration in Swift —
Sources/RxDataSources/. No evidence of security-related configurations in the codebase such as certificate pinning, secure storage practices, or input validation frameworks. While this is a data source library (lower risk), consumers of this library should implement their own security measures. Fix: Document security best practices for library consumers. Consider adding example implementations for secure data handling in the Examples directory. - Low · Carthage Lock File Present —
Cartfile, Cartfile.resolved, Carthage/. The Carthage/Checkouts directory and related lock files are present. While Carthage is a legitimate dependency manager, ensuring that dependency versions are pinned and verified is important. Fix: Ensure Cartfile.resolved is committed to the repository and regularly audit dependencies for security updates. Use Carthage's verification features for binary dependencies. - Low · No Dependency Version Pinning Specification Visible —
Package.swift, RxDataSources.podspec, Differentiator.podspec. While Package.swift and Podspec files are present, the exact version pinning strategy and security considerations for dependencies cannot be fully assessed from the file listing alone. Fix: Review all dependency specifications to ensure: (1) versions are explicitly pinned or constrained, (2) minimum deployment targets match security guidelines, (3) dependencies are from official sources only.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.