The Apple blog talked about Adwaita – a framework for developing GNOME applications on Swift

The Apple blog talked about Adwaita – a framework for developing GNOME applications on Swift

The author of the Adwaita framework talked about the possibility of developing GNOME applications on Swift with the help of their project. The article notes that Swift’s clean syntax is great for building user interfaces.

Native features of the Swift programming language are used to develop GNOME applications. The authors of the project note that the Adwaita framework already has implementations in Rust, Python, and JavaSript, but they all follow an imperative approach. For the development of user interfaces, according to the authors, it is more convenient to use a declarative approach. They came to him during the transition to Swift.

Another reason for switching to Swift, the authors of the project cite ease of development. The implementation is built on data, so if there is a button in the interface that changes the number of a variable, then the interface will automatically update simultaneously with the change of the number. In other programming languages, it is necessary to call a separate function that will change the content. If the final value needs to be saved to disk for use after a restart, then the variable simply needs to be given a special identifier:

@State("count") private var count = 0

Development in Swift together with the Adwaita framework ensures cross-platform. You can use a common codebase for applications under macOS, Linux, and Windows. In addition, you can use one backend for both SwiftUI and GNOME applications.

The first version of the Adwaita framework was released in September 2023. Since then, developers continue to actively update the tool. The framework code is open source and published on GitHub. In addition to the code, the repository includes documentation and a beginner’s guide.

Related posts