OpenSwiftUI
OpenSwiftUI copied to clipboard
How do OpenSwiftUI and SwiftUIEmbedded work?
Hi,
How do OpenSwiftUI and SwiftUIEmbedded work and how they are structured?
It seems that you are creating a renderer: https://github.com/Cosmo/Pixels
I'm creating this renderer: https://github.com/swiftfn/SkiaSwift
Demo: https://github.com/swiftfn/SkiaSwift/blob/master/Sources/Demo/main.swift
It's about 50% finished, I'm aiming to finish it soon.
I think it's very useful for your OpenSwiftUI project, so that you can focus on porting SwiftUI, instead of having to create your own renderer.
Hey @ngocdaothanh, thanks for reaching out!
OpenSwiftUI provides the infrastructure and SwiftUI DSL without any platform-specific code.
That means the actual rendering of a UI + Interaction and platform-specific elements is supposed to come from another project (like SwiftUIEmbedded for example).
This kind of separation will pave out the way for many different implementations of (Open)SwiftUI on various platforms without dictating how things should look and feel like.
I created SwiftUIEmbedded to show an extreme example of running SwiftUI outside of iOS, tvOS, watchOS or macOS on simple hardware.
This project depends on OpenSwiftUI and extends it with the actual rendering.
For 2D graphics I had these technologies / libraries in mind:
- SVG
- Desktop PostScript
- Cairo (https://www.cairographics.org)
- Cairo for Swift (https://github.com/PureSwift/Cairo)
- Opal (https://github.com/gnustep/libs-opal)
- Doggie (https://github.com/SusanDoggie/Doggie)
- Skia (https://skia.org)
- LittlevGL (https://littlevgl.com) …
I was quite overwhelmed with the many possibilities and also didn't want to bother to think about compiling C or other languages, writing bridges, testing etc.
So I created Pixels to keep things simple for now without having any external dependencies.
What I know, is that Pixels was great to have at least something, but keeping it as part of the project makes no sense for the future.
In the following days I'll work on some code clean up tasks, updating the README and make the project more friendly towards potential contributors.
Any suggestions or pull requests are welcome of course!
Also pointing out to a cross-platform rendering API bgfx, it supports all popular backend including(metal, vulkan, directx12) and another cross-platform swift UI framework already plan to moving its rendering backend to it
@ngocdaothanh are you still working on SkiaSwift?
I'm pausing SkiaSwift to work on a tool to automatically create Swift binding for Skia: https://github.com/swiftfn/Cpp4Susans
SkiaSwift is manual work, so every time Skia changes, SkiaSwift needs to be manually updated.
Oh, that's really cool!