Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wow, thanks for saying this. I had no idea it was even usable outside the Apple ecosystem. Seems like other IDEs support it too (https://www.swift.org/tools/).

How would UIs work on other platforms, though?



> How would UIs work on other platforms, though?

I think for right now, you'd have to use the C interop and link against something like GTK or other GUI library. I don't think SwiftUI specifically would ever work well cross-platform, it has so many Apple-isms.

There's also Swift/Win32, but it's MVC. You could also use the interop and use QT as well.

I don't think any of those are necessarily good solutions, but they are there.


What sort of things are you referring to when you say "Apple-isms"? Not that I doubt your claim -- I just don't do much UI development so I don't have a good reference for what things might be 'platform specific' in that way.


TokamakUI

And https://skip.tools


Hmm, Tokamak seems abandoned (hasn't been touched in years) and skip.tools requires xCode and is Android-only =/

Thank you though.


Yes there’s nothing all in one yet. But these are promising directions. Tokamak isn’t abandoned, members are involved in core Swift changes that it depends on and have made progress recently with embedded Swift.


As with other languages, you’d need bindings to another UI framework. In that sense, I wish SwiftUI had a different name because it seems intrinsic to Swift when it’s really no different than UIKit.

There’s stuff like SwiftCrossUI that does multiple backend bindings

https://github.com/stackotter/swift-cross-ui

And Qt was exploring some bindings using the new C++ interoperability.


There’s also Shaft, which is Flutter ported to Swift:

https://github.com/ShaftUI/Shaft

Like Flutter, this paints everything itself. It doesn’t need to bind to a UI framework directly. Instead, it needs the platform to provide primitives like a surface to draw into and input events.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: