pubky / pkarr

Public Key Addressable Resource Records (sovereign TLDs)
https://app.pkarr.org
MIT License
153 stars 17 forks source link

feat: ffi bindings for swift #53

Open Jasonvdb opened 6 months ago

Jasonvdb commented 6 months ago

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