This message was deleted.
# multiplatform
s
This message was deleted.
p
Perhaps creating a shared-umbrella module in kotlin, that wraps all the small shared ones. And expose the kotlin umbrella to swift.
As long as it remains in kotlin land transitive are fine. Perhaps there is a way to achieve what you want without the umbrella. But I am not aware of either.
s
Thanks for your fast answer!! So I should create a structure like this: sharedModuleA sharedModuleB sharedUmbrellaModule with sharedModuleA and sharedModuleB configured in the gradle.build.kts Then in the ios project import the umbrella module. What do you mean with expose the kotlin umbrella to swift?
p
Yes that's what I meant. By expose I mean, any public API you want to offer, do it from this umbrella module. You can in fact
export
A and B classes/functions to Swift.
Using api()/export should export the same classes name but you can customize them using @ObjCName annotation, in case the compiler adds some prefix
s
Thanks Pablichenko!
👍 1
b
hi @Pablichjenkov, I have quick dummy question. sharedModuleA and B have to be kmm module right? they should have commonMain, iosMain and androidMain as well as gradle script that specifies all targets (android(), iosX64(), iosArm64(), iosSimulatorArm64()). right?
p
@Bekzod, yes you are correct. Each lib module should support all targets a dependent module needs. Otherwise, the compiler will complain.
👍 1