Marc Reichelt
03/02/2022, 4:15 PMcom.foo.SomeClass
will be exported in iOS with Swift names SomeClass
. If our module exports a lot of those, and all the swift files import the module with import SharedCode
, there might be some conflicting Swift classes or classes from other libraries.
Does anyone have a good solution for this? Something like a namespace, or exporting multiple swift packages, or other approaches?ade
03/03/2022, 8:56 AMade
03/03/2022, 9:00 AMMarc Reichelt
03/03/2022, 10:27 AMfoo.Yay
and bar.Yay
will have different names on iOS (I think the second one will become Yay_
as of now).
I think what I want is something like namespaces, which Roman Elizerov mentioned a while ago here:
But since they are not available yet, I think what we should do right now is:
• be careful with public types in the multiplatform lib
◦ maybe even use the ‘Explicit API mode’ of Kotlin, to enforce developers to choose public/internal visibility
• reduce multiplatform API whenever possible
• prefix classes that have pretty common names with something
• maybe wrap some code in object SomeFeature { /* ... */ }
if possibleade
03/03/2022, 10:56 AM