https://kotlinlang.org logo
e

egorand

12/20/2019, 7:19 PM
If the native artifact of a multiplatform library is published as
klib
, is there a way for the consumer to transform it into a
framework
? Or does it have to be published as a
framework
?
s

Sam

12/20/2019, 9:02 PM
You would just create an mpp module, define an iOS target and tell it to use the dependency. I believe it has to be api rather than implementation in order to export it to your Swift/ObjC code. One can also just publish a framework but there is a caveat. Currently only one Kotlin framework can be included into an app at a time. For this reason, the common pattern is to make an umbrella framework that has all klib dependencies.
e

egorand

12/21/2019, 1:30 PM
Makes sense, thanks!