swift-toolkit is a free, open source publishing project written in Swift and released under BSD-3-Clause. It has 574 GitHub stars, 262 forks and 58 open issues, and was last pushed 5 days ago. On this registry it ranks #49 of 54 tracked projects in Publishing, with 5 head-to-head comparisons available. It gained 19 stars over the last 30 tracked days.

What is swift-toolkit?

The Readium Swift Toolkit is an open-source Swift library, licensed under BSD-3-Clause, for building iOS reading applications that handle ebooks, audiobooks and comics, and it is aimed at developers and publishers who need EPUB, PDF, audiobook and comic rendering inside their own app rather than a separate reader.

What it is

The Readium Swift Toolkit is a Swift library published by the Readium project, distributed under the BSD-3-Clause licence, and presented as the Swift half of Readium Mobile, a toolkit for ebooks, audiobooks and comics written in Swift and Kotlin. It lives in the Apple ecosystem, targets iOS applications, and provides an integration layer for SwiftUI, together with a Test App that demonstrates how the toolkit is embedded in a reading application. It is a library rather than a finished reader: an application supplies the interface and the toolkit supplies publication parsing, rendering and navigation.

The concrete problem it solves is that a reading application normally has to implement per-format parsing, layout and navigation before it can display anything. The toolkit replaces that work with a single pipeline: it parses a publication package such as EPUB or PDF, or a Readium Web Publication manifest, into Publication models, and then renders that model through a Navigator. The same model supports search, text-to-speech, highlighting and accessibility metadata inspection, so an application does not carry a different code path for every format it supports. It also covers audiobook and comic formats through the same model, and includes an OPDS parser for catalogue browsing.

Key capabilities

  • Parses publication packages and manifests, including EPUB, PDF and Readium Web Publication, into Readium Publication models.
  • Renders content through the Navigator, with pagination, scrolling and right-to-left support for EPUB reflowable, EPUB fixed-layout and PDF.
  • Searches textual content and navigates to matching results, and extracts text content for indexing.
  • Reads aloud textual publications through text-to-speech, with media overlays listed as planned.
  • Adds and manages highlights through the Decoration API, implemented for EPUB reflowable and EPUB fixed-layout and planned for PDF.
  • Supports the Readium Audiobook and Zipped Audiobook formats plus standalone audio files such as MP3 and AAC.
  • Supports comic formats Readium Divina and CBZ, while CBR is marked not planned.
  • Parses OPDS Catalog 1.2 and OPDS Catalog 2.0, and opens Readium LCP protected publications, with Adobe ACS marked not planned.

Who uses it and how

  • iOS application teams building a reader into an existing product, where the toolkit supplies parsing and rendering and a SwiftUI shell supplies the interface.
  • Audiobook and comics applications, which reuse the same Publication model for Readium Audiobook, zipped audiobook, MP3 or AAC audio and for Readium Divina and CBZ content.
  • Catalogue-driven applications that browse remote libraries through the OPDS parser, including OPDS Catalog 1.2 and 2.0 feeds.
  • Publishers and distributors using Readium LCP for protected content, since LCP is implemented while Adobe ACS is not planned.
  • Accessibility-focused applications, using the guide on inspecting accessibility metadata and presenting it to users.

Getting started

Start with the guide at docs/Guides/Getting Started.md, then run the TestApp in the repository, which demonstrates how to integrate the toolkit into a reading application. Project homepage and documentation entry point is https://readium.org/swift-toolkit.

How it compares

The README frames this project as part of Readium Mobile, alongside a Kotlin implementation for other platforms, so teams shipping on both Apple and Android platforms typically pair the two rather than replacing one with the other. For DRM it supports Readium LCP and explicitly marks Adobe ACS as not planned, which places it with the Readium LCP ecosystem instead of the Adobe content server route. The facts provided do not list commercial products that this toolkit is positioned to replace.

When to use it — and when not to

A team adopting it must maintain an iOS application shell around the library, and should read the guides for opening publications, configuring the Navigator and integrating with SwiftUI, because the toolkit renders content rather than shipping a complete product. Teams that need CBR comics, Adobe ACS DRM, or authentication for OPDS should not choose it on the evidence here, since those are marked not planned, planned or unimplemented respectively. The README excerpt supplied is also truncated, several features are marked planned or partially implemented, and the repository carries 58 open issues, so an adopters should verify current status against the live documentation before committing.

project readme (upstream, from github) — read inline

Readium Swift Toolkit

Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.

[!TIP] Take a look at the guide to quickly get started. A Test App demonstrates how to integrate the Readium Swift toolkit in your own reading app.

Features

✅ Implemented      🚧 Partially implemented      📆 Planned      👀 Want to do      ❌ Not planned

Formats

Ebook and Document Formats
Format Status
EPUB (reflowable) ✅
EPUB (fixed-layout) ✅
PDF ✅
Readium Web Publication 🚧
DAISY 👀
Audiobook Formats
Format Status
Readium Audiobook ✅
Zipped Audiobook ✅
Standalone audio files (MP3, AAC, etc.) ✅
DAISY 👀
Comic Formats
Format Status
Readium Divina ✅
CBZ (Comic Book ZIP) ✅
CBR (Comic Book RAR) ❌

Features

A number of features are implemented only for some publication formats.

Feature EPUB (reflow) EPUB (FXL) PDF
Pagination ✅ ✅ ✅
Scrolling ✅ 👀 ✅
Right-to-left (RTL) ✅ ✅ ✅
Search in textual content ✅ ✅ ✅
Highlighting (Decoration API) ✅ ✅ 👀
Text-to-speech (TTS) ✅ ✅ 👀
Media overlays 📆 📆

OPDS Support

DRM Support

Feature Status
Readium LCP ✅
Adobe ACS ❌

User Guides

Guides are available to help you make the most of the toolkit.

Publication

Navigator

DRM

Setting up the Readium Swift toolkit

Minimum Requirements

Readium iOS Swift compiler Xcode
develop 15.0 6.2 26.4
3.8.0 15.0 6.0 16.4
3.0.0 13.4 5.10 15.4
2.5.1 11.0 5.6.1 13.4
2.5.0 10.0 5.6.1 13.4
2.4.0 10.0 5.3.2 12.4

Dependencies

The toolkit's libraries are distributed with Swift Package Manager (recommended) and CocoaPods. It's also possible to clone the repository (or a fork) and depend on the libraries locally.

The Test App contains examples on how to use all these dependency managers.

Swift Package Manager

From Xcode, open File > Add Packages and use Readium's GitHub repository for the package URL: https://github.com/readium/swift-toolkit.git.

You are then free to add one or more Readium libraries to your application. They are designed to work independently.

If you're stuck, find more information at developer.apple.com.

CocoaPods

Add the following pod statements to your Podfile for the Readium libraries you want to use:

source 'https://github.com/readium/podspecs'
source 'https://cdn.cocoapods.org/'

pod 'ReadiumShared', '~> 4.0.0-alpha.1'
pod 'ReadiumStreamer', '~> 4.0.0-alpha.1'
pod 'ReadiumNavigator', '~> 4.0.0-alpha.1'
pod 'ReadiumOPDS', '~> 4.0.0-alpha.1'
pod 'ReadiumLCP', '~> 4.0.0-alpha.1'

Take a look at CocoaPods's documentation for more information.

Local Git Clone

You may prefer to use a local Git clone if you want to contribute to Readium, or if you are using your own fork.

First, add the repository as a Git submodule of your app repository, then checkout the desired branch or tag:

git submodule add https://github.com/readium/swift-toolkit.git

Next, drag and drop the whole swift-toolkit folder into your project to import Readium as a Swift Package.

Finally, add the Readium libraries you want to use to your app target from the General tab, section Frameworks, Libraries, and Embedded Content.

Building with Readium LCP

Using the toolkit with Readium LCP requires additional dependencies, including the framework R2LCPClient.framework provided by EDRLab. Contact EDRLab to request your private R2LCPClient.framework and the setup instructions.

Credits

This project is tested with BrowserStack.

Frequently asked questions

Is swift-toolkit free to use?

swift-toolkit is open source under the BSD-3-Clause licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does swift-toolkit do?

A toolkit for ebooks, audiobooks and comics written in Swift

What is swift-toolkit written in?

swift-toolkit is primarily written in Swift. Its source is publicly available at https://github.com/readium/swift-toolkit, and it has 574 GitHub stars.