GithubHelp home page GithubHelp logo

rgb-lib-swift's Introduction

RGB Lib Swift bindings

This project builds a Swift library, RgbLib, for the rgb-lib Rust library, which is included as a git submodule. The bindings are created by the rgb-lib-ffi project, which is located inside the rgb-lib submodule.

Usage

To use the Swift language bindings in your Xcode iOS or MacOS project add its GitHub repository (https://github.com/RGB-Tools/rgb-lib-swift) and select one of the release versions. Then link the C++ library by going to Build Phases -> Link Binary With Libraries -> Add items (+) and adding libc++.tbd. You may then import and use the RgbLib library in your Swift code.

Build and publish

If you are a maintainer of this project or want to build and publish this project to your own Github repository use the following steps:

# Update the submodule
git submodule update --init

# Add Apple rust targets
rustup target add aarch64-apple-ios x86_64-apple-ios
rustup target add aarch64-apple-ios-sim --toolchain nightly
rustup target add aarch64-apple-darwin x86_64-apple-darwin

# Generate the bindings and FFI ZIP
./generate.sh

Then update the Package.swift file with the new expected URL for the ZIP file and new checksum as shown at the end of the generate.sh script. For example:

.binaryTarget(
   name: "rgb_libFFI",
   url: "https://github.com/RGB-Tools/rgb-lib-swift/releases/download/0.1.1/rgb_libFFI.xcframework.zip",
   checksum: "ce1a1761674c0c5ca3fec4cbced05d1bfe377d0a7cab01d6727d4d03a2fab248"),

Commit the changed Package.swift file, then tag the commit with the new version number.

Finally, create a GitHub release for your new tag and upload the newly created ZIP to the new GitHub release and publish the release.

Now you can test the new package in Xcode. If you get an error you might need to reset the Xcode package caches: File -> Packages -> Reset Package Caches.

rgb-lib-swift's People

Contributors

appstefan avatar zoedberg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.