pkarr icon indicating copy to clipboard operation
pkarr copied to clipboard

feat: ffi bindings for swift

Open Jasonvdb opened this issue 1 year ago • 0 comments

Script for building a xcframework so Pkarr can be used in any swift project.

Still need to create a uniffi export in ffi/src/lib.rs for each function you want to expose and handle errors properly.

sh ffi/scripts/build_swift.sh

Drag ffi/bindings/pkarrbindings.swift and ffi/swift/Pkarr.xcframework into your xcode project and use:

let record = await resolve(publicKey: "pk:o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy")

Example app here: https://github.com/Jasonvdb/pkarr-ios/ Simulator Screenshot - iPhone 15 - 2024-02-22 at 21 08 18

Jasonvdb avatar Feb 22 '24 18:02 Jasonvdb