SwiftUI for non-Apple platforms (like Android, Web, Windows)

It's interesting swift-cross-ui looks very promising.

I'm specifically interested in the implementation on WinUI3. I compile and run this example on Windows 11 ARM VM via Parallels Desktop and I notice a problem with the positioning of controls in the window.

Any idea ?

Very cool, I'd be interested to try and see how it goes! SwiftCrossUI probably doesn't use many unusual UIKit features yet, it's all pretty standard.

Very strange, I'll look into that tomorrow! Just so I have enough context, is that window resizable at all? If so does the layout jump at all if you try to resize the window?

Yes, this is what happens. When the window is resizable, the content constantly jumps when resizing and cannot be fully viewed. This behavior is the same for all examples.

Sorry for the delay @Datagram. I just pushed some changes that fix WinUIBackend's support for display scaling (window sizing used to break when display scaling was anything other than 100%). I haven't tested the changes on Windows 11 yet, but I believe they should fix some of the issues that you faced. You will likely still experience jumpy resizing when resizing the window smaller than its content (gonna address that next), but fixed-size windows should work at least.

1 Like

Hi stackotter I'm experiencing the same issue when running the examples on Windows 11 ARM. The window contents are only partially displayed. Its easy to reproduce, just setup Windows 11 with Parallels Desktop on any Apple silicon Mac.

I'm also experiencing a new problem building the examples with Swift 6.1 (or the latest 6.2), the following error appears:

lld-link: error: too many exported symbols (got 67393, max 65535)

Seems a DLL exports too many symbols.

Note that this lld-link error only appears in debug mode using Swift 6.1 or the latest on Windows ARM. The lld-link error doesn't appear when building in release mode.

On Windows 11 Intel, everything works fine.

Please join us on the SwiftCrossUI discord!

1 Like

Not sure whether you’re the one who posted the issue on the SwiftCrossUI repo, but this general Windows DLL issue should be resolved if you use the latest commit.

Just discovered this gem and the swiftbundler package.
This is amazing y’all.

From a Windows 11, arm (via parallels) on a mac studio.
I was able to build and run the provided CounterExample a true windows app, written in no less of what appears to be pure swift UI syntax. Not that outdated imperative AppKit code.

For an old programmer deceived by true cross platform efforts many times this is a major win for the swift community.
I’m even more excited than when i compiled my first (Obj-C) OPENSTEP 4.2 app on a window NT in 1997.

Many many thanks.

6 Likes

I’m glad you enjoy the projects! :heart:

1 Like

Found this the other day: GitHub - OpenSwiftUIProject/OpenSwiftUI: Open source implementation of Apple's SwiftUI.

1 Like

Thanks for the mention. Yeah. We are adding Linux and Android GUI support recently.

I made it

1 Like