Possible to build a gui using swift package manager as the build system?

So far I’m having a great time just using Swift Package Manager to build and test swift code using vim and tmux. I’m also familiar with xcode and the build process there, but found getting a macos command line application to work with swift was not particularly easy (had linker errors with swift libraries using cocoapods/carthage). Swift package manager fixed that up, and for the primarily text based work I was using to verify algorithms were doing what I expected, it was great.

Now I’d like to visualize a particular tree-based algorithm. Is there any solution to this using swift package manager other than generating an xcode project and going full blown into xcode build?

Hey @jmoyers, it might be worth checking out GitHub - PureSwift/Cacao: Pure Swift Cross-platform UIKit (Cocoa Touch) implementation (Supports Linux)? Cross platform UIKit. Its in very early stages of development but it might be capable of achieving what you are looking for.

Good luck! :slight_smile:

Wow, thats an ambitious project! Thanks for the link, I’ll check it out. I was hoping that there was just a way to use AppKit directly, but I’m guessing not. On the SPM github repository, at some point they had posted that there is “no explicit support for AppKit, UIKit, etc…” I hopped there was unofficial support in some capacity, but I haven’t heard anything or seen anything anywhere that I’ve asked. Seems weird! I assume its primarily technical hurdles that stop this from happening. Or perhaps they want everybody focused on XCode. Seems weird to release a command line package manager with a build system, but not intend for people to use it.

With xvim (vim plugin for xcode) breaking with the new XCode release, I was hoping even more that this was possible.

AppKit and UIKit are intended for the Apple platforms so it wouldn’t make sense to include them with part of the Swift project as it wouldn’t translate across to Linux (completely different hardware, window manager etc) anyway :stuck_out_tongue:

They did however do a good job of including support for many Foundation APIs as this does translate well cross platforms (networking stack etc).

Eh. That seems to me a bad reason. Code is sometimes not portable. This doesn’t stop the hundreds of other package management ecosystems out there from Doing The Right Thing on the platform of choice, especially when 99.9999999% of the swift developers out there are targeting Mac or iOS. As it stands, its currently a toy for CLI development.

This topic was automatically closed after 166 days. New replies are no longer allowed.