icerockdev / moko-kswift

Swift-friendly api generator for Kotlin/Native frameworks
https://moko.icerock.dev
Apache License 2.0
351 stars 21 forks source link

Describe Xcode integration ways #44

Closed Alex009 closed 1 year ago

Alex009 commented 2 years ago

How to integrate without cocoapods, directly to project - https://github.com/Alex009/moko-kswift-usage-sample/tree/regular-framework How to integrate with cocoapods - call kswift****podspec task, add generated podspec to project podfile (sample in moko-kswift use this way)

alandoni commented 2 years ago

is this working for you? I tried using the snippet in your example to copy the swift file to generated, but still can't use swift framework, actually, it doesn't even create a framework for swift, it's only one file...

Alex009 commented 2 years ago

plugin not generates any framework. it generates swift files that you can compile with your project and kotlin framework. maybe links here help you

alandoni commented 2 years ago

well, it seems that with cocoapods it generates the library by itself, so I thought that it would generate the framework as well

lammertw commented 1 year ago

Is there any other way to integrate with Xcode without Cocoapods? If you copy it into Xcode, the file will be out of date whenever you change a sealed class. And my whole idea of using this project is not too miss any cases. And also creating an Xcode reference doesn't work since the file is put into a folder such as iosSimulatorArm64/debugFramework which changes based on current architecture and build configuration. I even tried to copy the file in an Xcode Run Script phase but that also doesn't work since the current architecture cannot be used during that (and is actually undefined). Or perhaps I am missing something?

hoc081098 commented 1 year ago

Is there any other way to integrate with Xcode without Cocoapods? If you copy it into Xcode, the file will be out of date whenever you change a sealed class. And my whole idea of using this project is not too miss any cases. And also creating an Xcode reference doesn't work since the file is put into a folder such as iosSimulatorArm64/debugFramework which changes based on current architecture and build configuration. I even tried to copy the file in an Xcode Run Script phase but that also doesn't work since the current architecture cannot be used during that (and is actually undefined). Or perhaps I am missing something?

See my comment https://github.com/icerockdev/moko-kswift/issues/55#issuecomment-1269254912