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

Objective-C interoperability for KMM #28

Open
OndraBasler opened this issue Jul 25, 2024 · 5 comments
Open

Objective-C interoperability for KMM #28

OndraBasler opened this issue Jul 25, 2024 · 5 comments

Comments

@OndraBasler
Copy link

I have a KMM project and I want to create a simple KMM library for Piano analytics. I am facing the issue that I don't see a generated API in Kotlin. The issue is that this library is pure Swift and its public API is not exported to Objective-C. Kotlin/Native can work only with Objective-C. According to the documentation, the easy fix might be to add @objc to all public API classes and functions.

I can create a workaround on my side by creating a Swift library that would expose relevant API to Objective-C in the meantime. However I believe that the simplest solution to add the annotations to this library. This change would open doors to creating the KMM library that can be used by everyone.

I created a sample KMM library where you can see that the API is not generated. There isn't the workaround for the current state

@adrienmu
Copy link

adrienmu commented Oct 2, 2024

i have the same issue !

@adrienmu
Copy link

adrienmu commented Oct 2, 2024

will you provide this useful changes @alexey-troshkov ?

adrienmu added a commit to adrienmu/piano-analytics-apple that referenced this issue Oct 4, 2024
@adrienmu
Copy link

adrienmu commented Oct 4, 2024

@OndraBasler i created a PR : #29
what do you think about it ?

@BenDz
Copy link
Member

BenDz commented Oct 4, 2024

Thank you for this, we will take a look at it!

@adrienmu
Copy link

Hello @BenDz, Have you been considering this PR for the next version of the SDK ? 🙏

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

3 participants