Repository navigation
Releases: jtCodes/EPUBReaderSwiftUI
Releases · jtCodes/EPUBReaderSwiftUI
Release list
v1.2.0
Highlights
- Added first-class highlighting support, including a built-in highlight edit popover.
- Added highlight notes support.
- Added full bookmarks support (toggle, list, navigate, delete, count badge, and richer metadata).
- Improved reader overlay behavior and UX, including preventing overlay toggles when tapping highlights.
- Updated default overlay font controls to a two-step interaction (show slider only after explicit tap).
Added
- Highlight model and wiring in the reader flow.
- Built-in highlight edit sheet/popover.
- Note field support for highlights.
- Bookmark model and reader actions:
- Toggle bookmark at current location.
- Bookmark list sheet with navigate/delete.
- Bookmark count badge and current-page bookmark state.
- Better chapter/title and text preview handling.
Changed
- Default overlay top and bottom bars were redesigned for a cleaner layout.
- Font sizing controls were compacted and then updated to a two-step reveal pattern.
- Interaction handling now suppresses accidental overlay toggles on highlight taps.
Documentation
- README updates to reflect new highlighting/bookmark capabilities and behavior changes.
Commits Included
263140a- Update EPUBReaderSwiftUI.swifta108b6e- Update EPUBReaderSwiftUI.swifte6232a9- Add bookmarks support to EPUB reader4be2794- Update README.md958f459- Suppress overlay toggle on highlight taps03a0d04- Add note support to EPUB highlights7b98e0f- Add default highlight edit sheet and popover9cbe480- Add highlight support to EPUBReaderSwiftUI6eb7a4c- Update README.md
v1.1.0
Release Notes — v1.1.0 (since v1.0.2)
Breaking Changes
EPUBReaderViewis now generic:EPUBReaderView<Overlay, TOCView>— the struct has two type parameters for the overlay and TOC view. Existing call sites using the default overlay/TOC compile without changes thanks to constrained extensions, but if you stored the type explicitly (e.g.var reader: EPUBReaderView) you'll need to update it.ReadingPreferences→EPUBReaderSwiftUIPreferences: The type is renamed. Apublic typealias ReadingPreferences = EPUBReaderSwiftUIPreferencesis provided for backward compatibility, but consider migrating.TableOfContentsView→DefaultEPUBReaderTOCView: Same treatment — typealias keeps old code compiling, but the canonical name changed.TOCRowremoved: The internalTOCRowhelper struct is eliminated; its logic is inlined intoDefaultEPUBReaderTOCView.loadEPUB(from:initialLocator:)→loadEPUB(source:initialLocator:): The view-model load method now takes anEPUBSourceenum instead of a rawURL. This is internal API but relevant if you subclassed or called the VM directly.
New Public API
| Symbol | Kind | Description |
|---|---|---|
EPUBSource |
enum |
.fileURL(URL) / .remoteURL(String, useCache:) — unified input for local and remote EPUBs. |
EPUBReaderOverlayContext |
struct |
Bundles all reader state & actions (title, author, currentLocator, showControls, fontSize, close(), showTableOfContents(), toggleControls(), goToProgression(_:)) for custom overlays. |
EPUBReaderTOCContext |
struct |
Bundles TOC state & actions (tableOfContents, currentLocator, navigateToLink(_:), dismiss()) for custom TOC views. |
DefaultEPUBReaderOverlay |
View |
The built-in overlay, now a standalone public view you can reuse or wrap. |
DefaultEPUBReaderTOCView |
View |
The built-in TOC, also extracted as a standalone public view. |
EPUBReaderSwiftUILocator |
typealias |
= Locator — lets consumers avoid import ReadiumShared. |
EPUBReaderSwiftUILink |
typealias |
= ReadiumShared.Link — same convenience. |
goToProgression(_:) |
VM method | Navigate to an arbitrary 0…1 overall progression. |
New Initializers on EPUBReaderView
All existing init(url:…) / init(remoteURL:…) / init(source:…) signatures still work unchanged (constrained extensions default Overlay and TOCView). New overloads add:
// Custom overlay only (default TOC)
init(source:…, overlay:)
init(remoteURL:…, overlay:)
init(url:…, overlay:)
// Custom overlay + custom TOC
init(source:…, overlay:, tocView:)
init(remoteURL:…, overlay:, tocView:)
init(url:…, overlay:, tocView:)Both overlay and tocView closures are @ViewBuilder and receive their respective context struct.
Other Changes
ReadiumSharedis re-exported (@_exported import) — consumers no longer need an explicitimport ReadiumSharedforLocator,Link, etc.loadingMessageis now@Publishedon the view model, so the loading screen shows "Downloading EPUB…" vs "Loading EPUB…" depending on the source.- Remote EPUB support baked into
EPUBReaderView— pass aremoteURL:string directly; the view handles download, caching, and error states internally (no more manualEPUBDownloaderdance required at the call site).
Migration Checklist
- Replace explicit
ReadingPreferenceswithEPUBReaderSwiftUIPreferences(or keep using the typealias). - Replace explicit
TableOfContentsView(tableOfContents:onSelectLink:)withDefaultEPUBReaderTOCView(context:)if you were constructing it manually. - If you want the old behavior with zero UI changes, no action needed — the default-overlay/default-TOC constrained extensions match the old signatures exactly.