Skip to content
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

Bridge C++ to Swift through Objective-C #20

Open
gabimoncha opened this issue Apr 17, 2022 · 1 comment
Open

Bridge C++ to Swift through Objective-C #20

gabimoncha opened this issue Apr 17, 2022 · 1 comment

Comments

@gabimoncha
Copy link

I understand that it's pretty impossible to call call C++ from Swift, but Swift could call ObjC methods.
In this article there is an example on how to use ObjC to bridge C++ to Swift and might be a good start to make this library support it too

https://anuragajwani.medium.com/how-to-consume-c-code-in-swift-b4d64a04e989

@alon7
Copy link
Contributor

alon7 commented Apr 17, 2022

Thanks for sharing, @gabrielmoncea. Codegen generates .mm files, and I couldn't find an easy way to implement the protocol of the generated code in Swift. Especially since there's a function you must call from our own .mm file that is entirely c++ (the JSI binding itself).

I would love to see a proof of concept with swift + nice binding but couldn't get one working by myself (invested about 2-3 hours in trying and making it happen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants