The goal of this post is to share how we, at the Browser Company, have made it possible to use Swift to build a modern Windows application. There is no UI framework for Windows written in Swift, and Windows itself is written in C++ – so that may leave you wondering, “how can I build my app on Windows”? Modern Windows applications use WinRT, a technology built on top of COM, which can interop really well with Swift, as we presented in our previous post. To be able to build idiomatic UI for Windows in Swift, we have built a language projection tool which creates idiomatic Swift language bindings for WinRT, and today we are open sourcing it at https://github.com/thebrowsercompany/swift-winrt. Swift/Winrt is based on Microsoft’s code generators for C++ (github.com/microsoft/cppwinrt) and C# (github.com/microsoft/cswinrt), and thus is written in C++.
Cool stuff.
Hm, I thought WinRT was deprecated in favor of Win32 after all? Aka Project Reunion. In that case it seems like this is a bit outdated already upon release. But please someone correct me if I’m wrong.
OK apparently WinRT is still very much the basis of current Windows development, it’s UWP that was deprecated. Just confusing since for a while those two stacks went hand in hand.
Its very very confusing. I thought it was deprecated in favor of Maui? IDK, I haven’t’ written anything new for windows in years. WinRt was just starting to take off when I left that world.
Maui is the newest Microsoft-developed option for cross-platform, it’s essentially a rewrite of Xamarin Forms. For “native” Windows development, WinUI 3 is the newest recommendation for greenfield projects. But the UWP-based WinUI 2 as well as good old WPF are still being supported and even further developed to some extent.