Release Note · Swift Toolkit Version 3.11.0

We are happy to announce the release of the Readium Swift Toolkit 3.11.0. This update gives you more control over audio session handling, makes LCP more robust across app reinstalls, and fixes several Navigator issues.

Release Note · Swift Toolkit Version 3.11.0

Browse the full release on GitHub

Bring your own audio session manager


If your app plays media outside of Readium — for example a podcast player or a text-to-speech engine — you may want full control over the AVAudioSession configuration instead of letting the toolkit manage it.

This release introduces the AudioSessionManaging protocol, which lets you provide your own audio session manager to the Navigator in place of the built-in AudioSession. This makes it possible to coordinate audio playback between the toolkit and the rest of your app without conflicts. Thanks to @svenmeyers89 for contributing this feature.

Smarter LCP handling


Several improvements make the LCP integration more resilient and flexible:

  • Device ID stored in the Keychain: The auto-generated LCP device ID is now stored in the Keychain instead of UserDefaults. It survives an app delete/reinstall, so a reinstalled app no longer needlessly consumes a license's device-registration slot. Existing IDs are automatically migrated, no action required on your part.
  • Passphrase preloading: LCPService has a new addPassphrase(_:isHashed:userID:provider:) method to store a passphrase candidate in the repository without opening a license first. This is useful to preload a passphrase ahead of time, for example when it is provided by a catalog.
  • Better profile detection: LCPClient has a new getSupportedLCPProfileURIs() requirement, letting the toolkit report LCPError.licenseProfileNotSupported based on the profiles your embedded liblcp actually supports. Update your LCPClient facade to forward R2LCPClient.getSupportedLCPProfileURIs(). A default implementation is provided for backward compatibility, so this is not a breaking change.


This release also addresses several issues in the Navigator:

  • Fonts declared with fontFamilyDeclarations now load correctly in the EPUB navigator. Font fetches were previously blocked by WebKit's CORS policy (contributed by @atani).
  • EPUB HREFs that are not percent-encoded but carry a fragment or query — such as chapter one.xhtml#section, with a space in the filename — now resolve correctly. This fixes table of contents links failing to navigate in poorly-authored EPUBs.
  • Custom EditingActions no longer go missing from the text-selection menu when double-tapping to select a single word (contributed by @raphi011).
  • Fixed a memory leak in the AudioNavigator.