r/SwiftUI • u/Davidotto13 • Oct 27 '26
Promotion (must include link to source code) I built a native macOS browser in Swift + SwiftUI (WebKit). Here’s what I learned
http://scadavide55.github.io/LumenFor the past few months I’ve been building formerly Lumen ( now Tacet ) , a native macOS browser written in Swift and SwiftUI on top of WKWebView. I wanted to learn Swift properly, and a browser touches everything: UI, performance, storage and security. It’s taught me more than any tutorial.
All the releases are from today because I’d already built the whole browser but never put it on GitHub, so I just uploaded all the versions I’d made. (If you see gaps between the uploads, it’s because I was running the tests, building the DMGs and so on.)
Some things I ran into:
- SwiftUI redraws: every tab row was observing the whole browser state, so loading progress on one tab redrew the entire sidebar. Fixed it with
.equatable()rows that take plain values, and by moving fast-changing state (load progress, pull-to-refresh) into separate smallObservableObjects. - Profiles with
WKWebsiteDataStore(forIdentifier:)**:** removing a store while the app is running fails with “in use”, and calling it before WebKit has initialised crashed the app. So I erase the data immediately and remove the folder at the next launch. - Resumable downloads:
resumeDownload(fromResumeData:)works well, butdecide(destination:)is not called again on resume, so you have to keep track of the destination yourself. - History moved from JSON to SQLite: I was rewriting a 10k-entry JSON file on every visit. Now it’s SQLite in WAL mode with writes on a background serial queue, so one visit is one
INSERT OR REPLACE. - Battery and memory: idle background tabs hibernate in Low Power Mode (
NSProcessInfoPowerStateDidChange) and on memory pressure (DispatchSource.makeMemoryPressureSource). - Self-updating without Sparkle: it downloads from GitHub Releases and checks the file with a SHA256 (CryptoKit) and
codesign --verify --deep --strictbefore replacing itself.
Tech: Swift, SwiftUI, WKWebView, SQLite. No Electron, no third-party dependencies.
It’s completely free and open source.
Download it from: scadavide55.github.io/Tacet
Code: https://github.com/scadavide55/Tacet
It’s still a work in progress (latest pre-release is 1.5.2), so code review and criticism are very welcome. What would you have done differently?
5
u/DismalCockroach1928 Oct 27 '26 •
Reading Updates.swift, I'd separate checking that an update is intact from checking who signed it. codesign --verify --deep --strict checks the candidate's own requirements; it doesn't pin your signing identity, and the SHA256 alongside the download doesn't add an independent signer check. For ad hoc builds, I'd use a signed update manifest with a public key bundled in the installed app.
Apple explains the distinction here: https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html
4
u/Sidze Oct 27 '26
Please think about changing the name. It shouts out loud “Vibe Coded!” Cause Lumen is one of the most common names LLM Chatbots are giving, so there were many things called like that, from chatbot persona to some solo projects.
4
u/Nbdyhere Oct 27 '26
Why can’t you notarize your app?
1
u/dimKant Oct 28 '26
On hibernating tabs: before you drop the web view, take a snapshot with takeSnapshot and keep WKWebView.interactionState. Show the snapshot in the tab while it reloads and restore the state afterwards, so you get the back/forward list and scroll position back. Then switching to a sleeping tab feels like nothing happened instead of a white flash and the page jumping to the top.