Hello good people. I am looking for some ways to p...
# ios
a
Hello good people. I am looking for some ways to publish a KMM library for iOS without sharing the source code. Any tips or ideas are very welcome.
l
If your plan is to consume it from Kotlin, you can follow the publishing guide. You’ll need a maven hosting service. I’d recommend using GitHub’s new package registry for now, then create a Maven Central account once you’re ready. Maven Central will not share the source code.
a
Thank you, this is very useful! I plan to use it from native iOS apps though, Swift being the primary target.
l
In that case, I’d look into a swift package gradle plugin. I personally use https://github.com/ge-org/multiplatform-swiftpackage, but there’s also other options.
a
This is incredibly helpful. Thank you!
s
I'll chime in here and say that you should consider distributing it both ways. The maven route is optimal for people that would want to consume the library from an iOS app that is using KMM. The iOS framework (via spm or CocoaPods) is good for people that just want an xcframework to add to Xcode. Of those apps ever consume a second Kotlin based framework, they'll have two Kotlin runtimes loaded into memory that can't easily talk to each other. Framework A’s Kotlin String is a different type than Framework B’s Kotlin String.
2