Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.01 KB

File metadata and controls

27 lines (19 loc) · 1.01 KB

xcode-rust-example

Xcode

Demonstrates the ability to generate the necessary bindings for a rust lib compiled for an apple target to be embedded and called by a Swift project in Xcode.

pre-reqs

  1. cargo
  2. xcode from Apple app store

Setup

rustylib rust library with two exposed functions
swiftyapp hello world ios app that imports and uses the two rust lib functions swiftyrustlib Swift package of rust lib

  1. Run build.sh
  2. Open the Xcode project located at swiftyapp/swiftyapp.xcodeproj.
  3. Ensure that RustyLib was successfully imported into project.
  4. Build and run the project in Xcode.
  5. Verify that the Rust library functions are successfully called from the Swift project.

Referenced Articles: