On this page
Overview
Swift Collections is an open-source package of data structures for Swift. It provides modules for deques, ordered sets and dictionaries, bit collections, heaps, persistent hash-tree collections, and other containers that complement the standard library.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Choose Deque, ordered collections, heaps, and other structures by module
DequeModule provides ring-buffer deques, OrderedCollections preserves insertion order for sets and dictionaries, and HeapModule provides a min-max heap suitable for priority queues. Applications can depend only on the modules they need.
Sources: [2]
Use persistent collections and ownership-aware containers when needed
HashTreeCollections provides CHAMP-based persistent sets and dictionaries, while BasicContainers includes ownership-aware variants of common generic collections.
Sources: [2]
Best fit
Fits Swift code with explicit queue, ordered-map, or priority-queue requirements
It is useful when a specialized data structure offers clearer complexity, ordering, or memory semantics than implementing the same behavior on top of Array, Set, or Dictionary.
Sources: [2]
Before adoption
Version 1.7.1 uses Swift tools 6.2 and includes a Swift 6.4 deployment workaround
Package.swift uses Swift tools 6.2. Release 1.7.1 works around a Swift 6.4 defect that prevented code using the package from deploying to macOS/iOS versions before 27, so Swift 6.4 users should use 1.7.1 or newer.
Official sources
- [1]apple/swift-collections — GitHub repository(2026-10-06)
- [2]Swift Collections 1.7.1 — README(2026-10-06)
- [3]Swift Collections 1.7.1 — Package.swift(2026-10-06)
- [4]Swift Collections 1.7.1 release(2026-10-06)
- [5]Swift Collections Apache-2.0 license(2026-10-06)
Supplemental curator note
Swift Collections fits code with explicit queue, ordered-map, priority-queue, or persistent-collection requirements. Swift 6.4 users should use 1.7.1 or newer for its deployment workaround.
Try it in 3 steps
- 1
Add Swift Collections 1.7.1 with SwiftPM
Pin 1.7.1, which includes the Swift 6.4 deployment workaround.
.package(url: "https://github.com/apple/swift-collections.git", exact: "1.7.1") - 2
Add DequeModule to the target
Link only the data-structure module the target needs.
.product(name: "DequeModule", package: "swift-collections") - 3
Use Deque as a FIFO queue
Use the ring-buffer-backed Deque for tail insertion and front removal.
import DequeModule var queue: Deque<Int> = [1, 2] queue.append(3) let first = queue.popFirst()
Growth
Growth trends · Last 30 days
4,515 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 66
- Open PRs
- 26
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- collection
- container
- deque
- dequeue
- hash
- ordered-dictionary
- ordered-set
- sequence
- queue
- Stars
- 4,515
- Forks
- 416
- Watchers
- 148
- Open issues
- 50
- Contributors
- 84
- Owner type
- Organization
- Primary language
- Swift
- License
- Apache-2.0
- Repository last updated
- Oct 1, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- kotlinx.serialization5,948 Stars
2 shared tag(s) · 1 shared category(s)
Generate multi-format encoding and decoding code from Kotlin types
Kotlin - QGIS14,467 Stars
2 shared tag(s)
Manage spatial editing, analysis, cartography, and server delivery in one GIS platform
C++ - Flutter179,343 Stars
1 shared tag(s) · 2 shared category(s)
build mobile, web, and desktop UI from one Dart codebase
Dart - React Native126,797 Stars
1 shared tag(s) · 2 shared category(s)
native mobile UI with React, stable 0.87.1, and a framework-first path
C++ - Electron123,388 Stars
1 shared tag(s) · 2 shared category(s)
bundle Chromium and Node.js to build desktop applications for three major operating systems with HTML, CSS, and JavaScript
C++ - Tauri111,593 Stars
1 shared tag(s) · 2 shared category(s)
Combine a web frontend and Rust native layer into desktop and mobile apps using system WebViews
Rust
Report incorrect information
Tell us if any listing information is incorrect or outdated.