{"canonical_url":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/","content_markdown":"# Built a native macOS client in Swift 6\n\nBuilt a native macOS messaging client in Swift 6 and SwiftUI — 11,141 lines across 53 files — over the C interface of a Rust core linked as a static archive from a pinned revision.\n\nAugust 2026\n\n**Situation.** The messaging protocol had a well‑tested core written in Rust and clients on several platforms, but the desktop experience on macOS was a cross‑platform shell — it did not look like a Mac application, did not behave like one, and carried a runtime that a native application does not need. The core exposes its capability through a C interface, which means any language that can call C can build on it, and Swift can.\n\n**Task.** A native client had to be built directly on that C interface, in the platform's current language and current interface framework, with the core linked in rather than shipped alongside.\n\n**Action.** The application is 11,141 lines of Swift across fifty‑three files in the app target, built on SwiftUI with the core linked as a static archive compiled from a pinned upstream revision. Pinning the revision rather than tracking a branch is the decision that makes the build reproducible: the C interface is the contract, and a moving core changes the contract without changing a line of Swift. The layering keeps the unsafe surface small — a thin wrapper owns every pointer and every string that crosses the boundary, models above it are ordinary Swift values, and the interface layer never sees a raw pointer. Everything the C interface returns has an ownership rule, and getting one wrong produces either a leak or a crash with no compiler warning in between, so the wrapper is where the entire project's memory discipline lives. The build is driven by a task runner with fifty‑six targets covering the core compile, the Swift build, the test suites, the linters and the packaging.\n\n**Result.** A native client that starts as a Mac application, uses the platform's own materials and controls, and carries no embedded browser. What has not been done should be stated: this is not a shipped release. There is no notarised distribution, no update channel, and one language in the interface, so it is a working application rather than a product anyone else is running.\n\n---\n\n- Role: macOS Application Engineer\n- Categories: [Solution Architecture](https://engineer.company/categories/solution-architecture/), [Frontend Engineering](https://engineer.company/categories/frontend/), [Full‑Stack Development](https://engineer.company/categories/full-stack/), [APIs \u0026 Integration](https://engineer.company/categories/api/), [Design Systems \u0026 UI](https://engineer.company/categories/design-systems/), [UX / UI Design](https://engineer.company/categories/ux-ui/)\n- Services: [Platform \u0026 Solution Architecture](https://engineer.company/services/platform-architecture/), [Frontend Development](https://engineer.company/services/frontend-development/), [Full‑Stack Product Development](https://engineer.company/services/full-stack-development/), [UI/UX Design \u0026 Design Systems](https://engineer.company/services/ui-ux-design/)\n\n\u003chttps://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/\u003e\n","date_modified":"2026-10-20T21:59:50Z","description":"A native client that starts as a Mac application, uses the platform's own materials and controls, and carries no embedded browser.","formats":{"gemtext":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/index.gmi","gopher":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/gophermap","html":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/","json":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/index.json","markdown":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/index.md","pdf":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/index.pdf"},"kind":"page","language":"en","title":"Built a native macOS client in Swift 6","url":"https://engineer.company/portfolio/built-a-native-macos-client-in-swift-6/","version":1}