Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sclukey/libui-swift
Swifty libui
https://github.com/sclukey/libui-swift
Last synced: 3 months ago
JSON representation
Swifty libui
- Host: GitHub
- URL: https://github.com/sclukey/libui-swift
- Owner: sclukey
- License: mit
- Created: 2016-09-06T04:24:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-19T03:56:44.000Z (over 7 years ago)
- Last Synced: 2024-07-05T13:46:05.995Z (4 months ago)
- Language: Swift
- Size: 38.1 KB
- Stars: 31
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libui-swift
This is an object oriented (and much more "Swifty") wrapper for [clibui](https://github.com/sclukey/clibui), which provides Swift bindings for [libui](https://github.com/andlabs/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 Tag | libui Version |
|-----------------|---------------|
| 1.0.x | Alpha3.1 |## Usage
To use this you need first to have a compiled version of libui. You can either [download the supported release](https://github.com/andlabs/libui/releases/tag/alpha3.1) 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`:
```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](https://github.com/sclukey/libui-swift-examples).