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

How can I implement SealedToSwiftEnumFeature for xcframework? #75

Open
Fostahh opened this issue Mar 27, 2023 · 3 comments
Open

How can I implement SealedToSwiftEnumFeature for xcframework? #75

Fostahh opened this issue Mar 27, 2023 · 3 comments

Comments

@Fostahh
Copy link

Fostahh commented Mar 27, 2023

So I've created a KMM Library project, not KMM App project. I've follow all the steps in your Github Readme and Medium How to implement Swift-friendly API with Kotlin Multiplatform Mobile. I've created the sealed class
image
And after I generate it into XCFramework ./gradlew assembleXCFramework, the sealed class still convert into this
image

Am I doing it wrong? If you wanted to check out my code, here's the repository https://github.com/Fostahh/MySharedKMMLibrary

@Fostahh Fostahh changed the title How can I implement SealedToSwiftEnumFeature? How can I implement SealedToSwiftEnumFeature for xcframework? Mar 27, 2023
@Alex009
Copy link
Member

Alex009 commented Mar 27, 2023

@Fostahh generated swift code not part of xcframework. swift code located in build directory. check this sample - Alex009/moko-kswift-usage-sample@fc92131

@Fostahh
Copy link
Author

Fostahh commented Mar 27, 2023

@Alex009 thank you so much for replying! But in my case, I don't have any iosApp or androidApp module in this KM Lib Project since I'm going to use this as a library or SDK. Then, I'm going to link this KM Library/SDK into my existing Xcode project. Is this possible to implement sealed class for my case?

@Fostahh
Copy link
Author

Fostahh commented Mar 27, 2023

I already have the generated swift code by kswift like this
image

Build the xcframework and link it into my Xcode project. Then copy the generated swift code file into my Xcode project too. The result is like this
image

Since the function returns this
image

image

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