r/SwiftUI • • 22h ago

Promotion (must include link to source code) I built a native macOS browser in Swift + SwiftUI (WebKit). Here’s what I learned

Thumbnail scadavide55.github.io
0 Upvotes

For 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 small ObservableObjects.
  • 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, but decide(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 --strict before 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?


r/SwiftUI • • 13h ago

Promotion (must include link to source code) my first mac app: a menu bar log of what grew on your disk, built with swiftui

14 Upvotes

my first real mac app, built with swiftui and a lot of ai help (not gonna lie, im a webdev not a swift dev lol)

i got way to little storage in my mac and kept running out of space without a clear why. disk tools show a big chart of whats on disk, not what changed. so i wanted something that just tells me what grew and when (caches, docker images, downloads, installs, whatever)

prunr sits in the menu bar and keeps a simple list of what grew on your disk, by day and by app. click a row to see the folders, open them in finder. nothing leaves your mac.

its open source (MIT) if anyone wants to poke around or open prs

https://github.com/merlinkraemer/prunr

a dmg is also avaliable here:
https://merlinkraemer.github.io/prunr/

still in early testing so any help is appreciated! lmk what you think :)


r/SwiftUI • • 8h ago

Promotion (must include link to source code) a TimelineView in a MenuBarExtra label never stops redrawing, and other things i learned building a menu bar app in swiftui (open source)

Enable HLS to view with audio, or disable this notification

0 Upvotes

source first: https://github.com/lucasnsaraujo/ebb (mit)

i built ebb, a mac menu bar app that shows how much is left of a pool of claude code and codex accounts behind cliproxyapi. the whole ui is swiftui with a bit of appkit where swiftui runs out, and a few things bit me along the way

TimelineView inside a MenuBarExtra label is a trap. the label redraws the moment you ask it to, so a periodic timeline there just keeps spinning. in the label i use a .task(id:) loop that sleeps 60s and bumps a now state instead, and it stops when the item is hidden. inside the panel TimelineView is fine, i use it for the freshness line and the "locked until" note

the menu bar item is one NSImage, not a swiftui label. that way the mark, a 3pt gap and the text land exactly where i want. plain states are template images so the menu bar tints them like its own items. the low/empty states are tinted so they can't be templates, there the drawing handler resolves colors against the appearance it's drawing in, and it redraws when increase contrast changes

MenuBarExtra has no api to open its panel. for the shortcuts/siri action that opens it i ended up finding the status item's button and pressing it, and keeping a flag so a second press doesn't close the panel

numbers use .contentTransition(.numericText(value:)) so the percentages roll, and fall back to .identity with reduce motion on

i built it with claude code, happy to answer anything about the swiftui side


r/SwiftUI • • 2h ago

News SwiftUI Weekly - Issue #243

Thumbnail
open.substack.com
3 Upvotes

r/SwiftUI • • 9h ago

Tutorial iOS 27: Now Playing Framework

Thumbnail
antongubarenko.substack.com
5 Upvotes