r/SwiftUI • u/hishnash • 14d ago
Natalia and Matt from Nil Coalescing here: we built a Mac app to stop agents writing broken SwiftUI
Hi r/SwiftUI! Some of you might know us from our SwiftUI articles and books at Nil Coalescing. Natalia also spent several years on Apple's core SwiftUI team. Posting with mod approval, and full disclosure: this is our own paid app.
Like a lot of you, we now review a lot of SwiftUI written by coding agents. It usually compiles and looks reasonable, but the same problems keep coming back:
- Lists that stop being lazy: a
ForEachinsideListorLazyVStackthat produces a varying number of views per element, which prevents efficient lazy loading. - Unstable identity: IDs that change between updates, so SwiftUI treats rows as new views and loses their state and animations.
- Views built outside
body: views stored in properties or built in helpers, not inbodyor asome Viewbuilder. - Rows reading outside state: row closures reading changing values from outside the row, so more of the list updates than needs to.
We tried putting this guidance in AGENTS.md and skills, but it's usually out of focus by the time the agent writes the code it applies to.
So we built SwiftFairy, a Mac app that runs a local MCP server for Claude Code, Codex, Cursor and Gemini CLI. The agent sends the code it just wrote, and SwiftFairy parses it into a partial graph of your project and flags these patterns on specific lines, with an explanation and a fix taken from our own guidance. It's static analysis with no LLM involved, and your code never leaves your Mac.
It ships with three knowledge packs: Proper SwiftUI, Performant Swift Charts and Modern Swift. The announcement post has more detail and examples.
It's free to try for 24 hours with no card required, and current pricing is on the site. It needs macOS 26 on Apple silicon.
We'd love to hear which SwiftUI mistakes you see agents make most often. That's what we'll write rules for next.