-
Notifications
You must be signed in to change notification settings - Fork 221
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 implemented traits to generated code, or add extension? #2169
Comments
extension STRUCT_NAME: Trait {}
?extension STRUCT_NAME: Trait {}
for swift ?
In android I can do this open class Bip39AutoComplete : org.bitcoinppl.cove.Bip39AutoComplete(), AutoComplete {} Though it probably just makes sense to add them directly to already generated kt file open class Bip39AutoComplete :
Disposable,
AutoCloseable,
- Bip39AutoCompleteInterface {
+ Bip39AutoCompleteInterface, AutoComplete {
constructor(pointer: Pointer) {} |
extension STRUCT_NAME: Trait {}
for swift ?
This is likely to be tricky for a few reasons - one is capturing the metadata, but the other is mapping the semantics to all supported bindings once we end up with many such traits (ie, with multiple inheritance) - eg, Kotlin has a very strange inheritance story. I wonder if we can instead come up with a way so that the swift binding generator alone can be told (eg, via uniffi.toml) about the desired hierarchy or similar?) But regardless, I don't see an easy answer here. |
I have the following trait
And this SwiftUI component
But I can't automatically pass in
Bip39AutoComplete
into the SwiftUI component. To get it to work I have to do the following on the swift side.It's not a big deal, just one line, but I was wondering if it could be added to the already generated code as below:
The text was updated successfully, but these errors were encountered: