Navigating the Ecosystem¶
Now that Swift is installed, there’s still a major problem: the ecosystem. Many Swift libraries are designed with macOS and/or iOS in mind, meaning they rely (either intentionally or accidentally) on Cocoa APIs and Darwin C library bindings.
The best indicator that a library will work on Linux is if it mentions pure Swift somewhere in the name. This term basically means that it likely won’t depend on any Cococa APIs, at minimum.
In addition, the presence of a
Package.swift file, used by the Swift package
manager, means that it doesn’t require something like CocoaPods to build.
Note that when I say pure Swift, I’m not referring to this GitHub organization. Although they create pure Swift libraries, that’s about it.
Here are some awesome libraries that work on Linux: