Home

Awesome

libui-swift

This is an object oriented (and much more "Swifty") wrapper for clibui, which provides Swift bindings for libui.

Swift Version

This package is tested with Swift 3, earlier versions of Swift will be ignored completely. Specifically, this is compatible with Swift 3.0 Preview 6 and above.

libui Version

Currently this package is built to support libui version Alpha3.1. I intend to update this for each release version, but between releases libui's HEAD may not be supported.

libui-swift Taglibui Version
1.0.xAlpha3.1

Usage

To use this you need first to have a compiled version of libui. You can either download the supported release or compile libui yourself. Note that if you compile yourself you should take care to use the same version that this package expects — the libui API is currently very unstable.

Then, add the dependency to this module in your Package.swift:

.Package(url: "https://github.com/sclukey/libui-swift.git", majorVersion: 1)

Finally, when compiling a project that uses this package you need give Swift the location of the compiled library and the ui.h header file. Assuming you extracted the release package to /path/to/libui, you are on 64-bit Linux, and you want a static build, then you would need to use

swift build -Xswiftc -I/path/to/libui/src -Xlinker -L/path/to/libui/linux_amd64/static

Examples

There are example programs available here.