-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add callback interfaces for Swift #1066
Conversation
Co-authored-by: Paul Griffin <[email protected]>
Re-work to fit in to the new structure Change to FfiConverter language cargo fmt Add docs to include swift
Kotlin relies on Handle instead of Long (or ULong) Align kotlin implementation with swift
c5bbc25
to
0c66759
Compare
0c66759
to
f17be20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had just a couple of suggestions, overall this is looking awesome!
Looks great thanks @jhugman! |
I have experience error when tried to add main uniffi after this commit Compiling uniffi v0.14.0 (https://github.com/mozilla/uniffi-rs.git?branch=main#d2b8d56a) For more information about this error, try |
* Added swift callback support * Temporary fix for running callbacks in another thread * Generate all the required swift code * Make run_uniffi_bindgen_test build * [wip] add tests for callbacks (mozilla#1) Co-authored-by: Paul Griffin <[email protected]> * Fix nits * Fit new Swift callbacks into the new Unit of Code structure Re-work to fit in to the new structure Change to FfiConverter language cargo fmt Add docs to include swift * Backfill Kotlin callbacks to closer match the Swift implementation Kotlin relies on Handle instead of Long (or ULong) Align kotlin implementation with swift * Fixup markdown weirdness * Address self-review * Address reviewer comments Co-authored-by: Paul Griffin <[email protected]> Co-authored-by: Paul Griffin <[email protected]>
@DAOCUONG I'm seeing the same issue. If you don't need to use the absolute latest code, you could try using uniffi from crates.io until it's fixed. @jhugman I think it's just a one-liner, but it's hard to test because it only runs when |
Thank you so much! When can we expect the next release? |
Just pushed it out, 0.14.1 should have what you need. |
It doesn't compile: |
I'm not sure what's happening, but it looks like you have version of the scaffolding built with the older unify. I would try That CI failure is related, but I don't think it's the cause of your issue. |
Reinstall uniffi_bindgen will help |
I think DAOCUONG might be right, it seems to me that
If that doesn't work, feel free to reach out on matrix or email me directly ([email protected]). |
Thanks @bendk , @DAOCUONG I did uniffi-bindgen --version and got After your responses, I did cargo clean
cargo uninstall uniffi_bindgen
cargo install uniffi_bindgen
cargo build and it worked. |
} | ||
``` | ||
|
||
Note: in Swift, this must be a `class`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't it be a struct
Fixes #353. It brings Swift parity with Kotlin, from #344 .
This is a rebase of #1045 by @pagr, following landing of #1042 and #1061.
Contributors @pagr and @patrick-fitzgerald will be interested in this.
Also in this PR:
deleted theexamples/callback
which seemed to be a duplicate to thefixture/callbacks
directoryffi_converter
language @bdk pioneered.