Swift Adwaita

Swift Adwaita

An open-source, imperative Swift 6 wrapper for GTK4 and libadwaita, designed for building truly native GNOME desktop applications in Swift. The library brings the elegance and type safety of modern Swift to the Linux desktop, allowing developers to write fully native GTK4 apps without ever touching a raw C pointer or fighting with string-based APIs.

Unlike declarative DSL-based approaches, Swift Adwaita stays close to the underlying GTK4 model — you create and configure widgets directly, which makes the mental model predictable, debugging straightforward, and the path from existing GTK documentation to working Swift code very short. At the same time, the API takes full advantage of Swift 6: complete @MainActor isolation, Sendable types, async/await for file dialogs and clipboard access, and fluent setters with method chaining like Label("Hi").halign(.center).cssClass(.title1).

The library ships with 178 widget wrappers (including a separate AdwaitaWebKit product for embedding WebKitGTK 6.0), type-safe enums replacing stringly-typed APIs (SignalName, PropertyName, CSSClass, IconName), property bindings, keyboard shortcuts, drag & drop, CSS theming, animations, Cairo-based drawing, gettext localization, a @Setting property wrapper for type-safe GSettings binding, and adaptive layout helpers. The codebase is covered by over 1,100 tests on both Linux and macOS, with CI running on Ubuntu and macOS, and includes a demo gallery with 78 examples showcasing every widget.

Swift Adwaita supports Linux as the primary target and also runs on macOS 13+ (via Homebrew), with full Flatpak distribution support for shipping apps through the GNOME runtime. It powers Swifty Notes and other native GNOME apps written entirely in Swift.

The source code is available on GitHub and you can add it to your project via Swift Package Manager:
https://github.com/makoni/swift-adwaita

Full API reference and documentation are available here.

Star Fork