Appendix K: Claudes X26 Swift6 Bible — iPad Reader App (Shop Manual)
Status: v1.0 pre-release. Created 2026-04-20. Distribution-ready binary for iPhone, iPad, and Mac (via Designed for iPad on Apple Silicon). GPL v3 — share and share alike, attribution required. Public repo at github.com/fluhartyml/Claudes-X26-Swift6-Bible. Claudes X26 Swift6 Bible is the native SwiftUI reader engine for this book's content vault. The vault is a tree of HTML rich-text documents (Books, Appendices, Lexicon Pages, Build-Alongs, figures); the app renders any of those files inline via WKWebView, with a sidebar that mirrors the vault's folder structure.
What it is
A universal reader for the book's HTML vault. The vault is the canonical authoring format — HTML, not markdown, because rich text survives the trip to print and EPUB without a translation step. Obsidian was considered as the authoring surface and is good at file-tree navigation and full-text search, but it does not render standalone .html files inside its own panes. The reader app fills that gap with a SwiftUI shell + WKWebView content pane.
The reader serves three roles at once:
- Authoring navigator while the book is being written.
- Reader app for anyone consuming the book on iPhone, iPad, or Mac.
- EPUB packaging cockpit — the vault's HTML files are already EPUB-shaped, so building an EPUB is a package step, not a translation step.
The final paperback and EPUB still ship through Apple Books, Amazon, and the other print / EPUB venues. The reader app is the in-house tool that makes the vault usable as a vault rather than as a folder full of HTML files.
Architecture overview
SwiftUI app, no SwiftData, no networking. The data is the vault — a bundle of HTML files copied out of the app target into Application Support on first launch.
File roles:
- App entry:
Claudes_X26_Swift6_BibleApp.swift(the@mainscene),ContentView.swift(the post-onboarding shell — sidebar + reader pane). - Onboarding:
OnboardingView.swift— first-launch flow that extractsBibleContent.bundlefrom the app target into Application Support so the vault is editable on device. - Vault plumbing:
VaultModel.swift— the in-memory tree representation of the vault (Parts → Books → Chapters → Pages, plus Appendices, Front-of-Book, Back-of-Book).VaultBundleExtractor.swift— copies the binary's flat bundle layout into the proper subfolder structure on disk via atargetPath(forFlat:)routing function (referenced in Book 11 as a completeFileManagerexample).VaultURLSchemeHandler.swift— custom URL scheme handler that lets HTML in the WKWebView link to other vault files using relative paths.VaultWebView.swift— theUIViewRepresentablewrapper aroundWKWebViewthat renders each selected HTML page.
- Under the Hood:
UnderTheHoodView.swift— in-app source-mirror feature, the SwiftUI surface that lets the reader browse the app's own files. Paired withAboutView.swiftfor the standard about page. - Notes:
Claudes_X26_Swift6_Bible_DeveloperNotes.swift(canonical roadmap and project relationships).
The vault — data and folder structure
The vault lives at ~/Developer.complex/Claudes-Xcode-26-Swift-Bible/ during development and inside Application Support on a reader's device. The structure mirrors the reading order:
- Front-of-Book — table of contents, dedication, prefatory material.
- Part-I-Introduction — Books 1, 2, 3 (the meta-orientation Books).
- Part-II-The-Swift-Language — the Lexicon (Chapters A through Z, each containing per-headword Page files).
- Part-III-The-User-Interface through Part-VI-The-Modern-Toolchain — Books 4 through 22.
- Part-VII-Dedicated-Build-Alongs — the build-along chapters and source-tour folders.
- Appendices — the framework manuals (B–E) and app shop manuals (F onward, including this one).
- Reference — cross-cutting reference pages linked from chapters.
- Screenshots and figures — per-chapter image assets.
Every leaf is a standalone HTML file with its own <head>, styles, and hyperlinks. The folder tree IS the table of contents.
Rendering pipeline
When the user selects a sidebar entry:
ContentViewresolves the selection to a file URL viaVaultModel.- The URL is passed to
VaultWebView, which is aUIViewRepresentablewrappingWKWebView. - The web view loads the file via
loadFileURL(_:allowingReadAccessTo:)with read access scoped to the vault root, so relative links to images and other HTML files resolve. - Hyperlinks the user taps go through
VaultURLSchemeHandler, which intercepts vault-relative paths and routes them to the appropriate file inside the extracted vault rather than handing them to Safari.
First-launch extraction
The Bible vault ships inside the app target as a flat-layout resource bundle (BibleContent.bundle). On first launch:
OnboardingViewshows a brief progress affordance.VaultBundleExtractorwalks the flat bundle and copies each file into its proper subfolder inside Application Support, usingtargetPath(forFlat:)to route Books toPart-N/, Build-Alongs toPart-VII-Dedicated-Build-Alongs/{folder}/, Lexicon Pages toPart-II-The-Swift-Language/Chapter-X/, and so on.- Subsequent launches skip extraction and read directly from the Application Support copy.
The flat-layout source + structured-layout destination pattern is what Book 11 references as a complete extract-from-bundle FileManager example.
Build + deployment
- Platforms: iPhone, iPad, Mac (Designed for iPad on Apple Silicon).
- Frameworks: SwiftUI (shell), WebKit (
WKWebViewfor HTML rendering), Foundation (FileManagerfor vault extraction). - No networking, no SwiftData, no accounts. The vault is local. Everything renders from disk.
- License: GPL v3 — share and share alike, attribution required.
- Distribution: v1.0 pre-release. GitHub clone-and-build is the default path. App Store is the bonus tier for the eventual reader-facing release.
Relationship to other projects
- Claude's Web Wrapper (Appendix J) — the App-Store-live WKWebView app whose patterns shaped this reader's web-view layer. Where similar problems arose, the Wrapper's solution was the starting point.
- DiamondNotesVault (in the NightGard family) — the generic notes-vault scaffold whose structure inspired this project's organization. Not used as a code dependency; the reader is a fresh Xcode 26 scaffold.
- InkwellJournal / InkwellBinary — sibling reader apps under the same publisher identity. Same author, different editorial purposes.
Known gotchas
- Flat bundle layout vs. structured on-disk layout. The reason: app-bundle resources can't ship as nested folders without per-file
Copy Files Phaseentries, which would be tedious for hundreds of HTML files. The flat layout in the binary plus the extractor routing function inVaultBundleExtractor.swiftis the actual mechanism. - Vault URL scheme vs. Safari handoff. Plain
http://orhttps://links in vault HTML are handed to the system (Safari opens). Vault-relative paths and a customvault://scheme are intercepted byVaultURLSchemeHandlerand resolved inside the app. Mixing these is the most common source of "link does nothing" bug reports during development. - The reader is passive. Per
feedback_cubic_zirconia_book_is_passive.md, book content can't address the reader as if the reader can ask the book questions. Inside the reader app the same rule holds: nothing the app does prompts the reader to do anything in a way that wouldn't also make sense for a print reader. The reader is a navigator and a renderer, not a tutor. - EPUB build is a future step. The vault's HTML is EPUB-shaped — one HTML per spine entry, plus stylesheets and figures — but the actual EPUB packaging (manifest, NCX, container.xml, OPF) lives at the vault root. Build is currently a manual process; "Build EPUB" as an in-app action is on the v1.x list.
Roadmap status
v1.0 (MVP — Vault Reader)
- Universal SwiftUI shell with sidebar + WKWebView content pane.
- Flat-bundle extraction on first launch.
- Vault URL scheme handler for in-app link routing.
- Under-the-Hood view (in-app source mirror).
- About page with the standard portfolio + contact footer.
v1.x — Pending
- "Build EPUB" in-app action (package the vault into an Apple Books / Amazon-ready EPUB without leaving the app).
- Full-text search across the vault.
- Reader bookmarks + reading position resume.
- Print export (per-Part or whole-book PDF).
Sources
- Project source: github.com/fluhartyml/Claudes-X26-Swift6-Bible (verified 2026-05-10).
- Canonical roadmap:
Claudes X26 Swift6 Bible/Claudes_X26_Swift6_Bible_DeveloperNotes.swiftin the project repo. - Vault canonical location:
~/Developer.complex/Claudes-Xcode-26-Swift-Bible/. - Related: Appendix J (Claude's Web Wrapper, WKWebView shape).
- Book 11 cross-reference: extract-from-bundle
FileManagerexample. - Book 13 cross-reference: sidebar-and-detail
NavigationSplitViewshape.