ページ内ナビ
概要
Swift CollectionsはSwift向けのopen-source data structure packageです。Deque、OrderedSet/OrderedDictionary、BitSet/BitArray、Heap、persistent hash tree collectionsなど、standard libraryを補完するcollectionをmodule単位で提供します。
特徴と向いている用途
公式資料に基づく紹介・実機未検証 · 内容確認日:
主な特徴
用途別moduleからDeque・Ordered collection・Heapなどを選ぶ
DequeModuleはring-buffer based deque、OrderedCollectionsは挿入順を保持するSet/Dictionary、HeapModuleはpriority queue向けmin-max heapを提供します。必要なmoduleだけdependencyとして追加できます。
出典:[2]
persistent collectionやownership-aware containerも利用する
HashTreeCollectionsはCHAMP based persistent set/dictionary、BasicContainersはownership-awareなArray/Set/Dictionary variantを提供し、copyやmutation特性に応じてstandard collection以外の選択肢を使えます。
出典:[2]
向いている用途
queue・ordered map・priority queueなど明確なdata structure要件があるSwift codeに向く
標準Array/Set/Dictionaryで代替実装するより、目的に合う計算量・順序・memory semanticsを持つcollectionを使いたいapplication/libraryに適します。
出典:[2]
導入前の確認
参考にした公式資料
- [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)
編集部からの補足
queue・ordered map・priority queueなど明確なdata structure要件があるSwift codeに向きます。Swift 6.4利用時はdeployment workaroundを含む1.7.1以降を基準にしてください。
3ステップで試す
- 1
Swift Collections 1.7.1をSwiftPMへ追加する
Swift 6.4 deployment workaroundを含む1.7.1をversion固定します。
.package(url: "https://github.com/apple/swift-collections.git", exact: "1.7.1") - 2
DequeModuleをtarget dependencyへ追加する
利用するdata structureのmoduleだけをtargetへlinkします。
.product(name: "DequeModule", package: "swift-collections") - 3
DequeをFIFO queueとして使う
ring-buffer based Dequeで末尾追加と先頭取り出しを行います。
import DequeModule var queue: Deque<Int> = [1, 2] queue.append(3) let first = queue.popFirst()
成長
成長の推移 · 直近30日
4,515 Stars
推移データを蓄積中です。
開発アクティビティ
直近90日・週次
- Commit(直近30日)
- 66
- Open PR
- 26
開発アクティビティを蓄積中です。
Built with
カテゴリとタグ
カテゴリ
GitHubデータ
GitHubのデータGitHubの詳細データを見る
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
- 所有者種別
- Organization
- 主要言語
- Swift
- ライセンス
- Apache-2.0
- リポジトリ最終更新
- 2026/10/01
関連情報
関連記事を投稿するこのOSSの使い方や活用事例をMarkdownで投稿できます。管理者が承認した後に公開されます。
あわせて探訪
- kotlinx.serialization5,948 Stars
共通タグ 2件 · 共通カテゴリ 1件
Kotlinの型から複数形式の読み書きコードを生成する公式ライブラリ
Kotlin - QGIS14,467 Stars
共通タグ 2件
spatial dataの編集・解析・cartography・server配信を一つのGIS platformで扱う
C++ - Flutter179,343 Stars
共通タグ 1件 · 共通カテゴリ 2件
Dartの一つのcodebaseからmobile・web・desktop UIを構築するcross-platform SDK
Dart - React Native126,797 Stars
共通タグ 1件 · 共通カテゴリ 2件
React componentをnative UIへ描画するmobile framework。0.87.1とframework-first導線を整理
C++ - Electron123,388 Stars
共通タグ 1件 · 共通カテゴリ 2件
ChromiumとNode.jsを同梱し、HTML・CSS・JavaScriptから3 OS向けdesktop appを構築するruntime
C++ - Tauri111,593 Stars
共通タグ 1件 · 共通カテゴリ 2件
web frontendとRust native layerをsystem WebView上のdesktop/mobile appへまとめる
Rust
情報の誤りを報告
掲載内容に誤りや古い情報があればお知らせください。