Hello! I work in a KMP project, and on the iOS sid...
# multiplatform
d
Hello! I work in a KMP project, and on the iOS side, in Xcode, code completion is very slow. I suspect it's due to a very big header-file (the exported kmp header in objc format). Our header is 28k lines of code. 1. Do you agree that the case if slow code completion could be due to the size of this header? 2. Is the header big in comparison to headers in other KMP headers?
f
tips for reducing the header : • use explicitAPI() to expose what you really need • in your shared lib, if one of your code have the visibility public, it will be exposed in the objc header.
d
Nice! Yeah, that's a great tip, thanks!
f
FYI, in swift everything is internal by default but in Kotlin it’s public/open.
d
Yeah, was just made aware of that the other day, kinda crazy imo, but there' surely reasons for it.
m
Here's a post on why Kotlin chose public. I do think internal would have been better. I prefer defaults to be restrictive instead by default. https://discuss.kotlinlang.org/t/a-bit-about-picking-defaults/1418
f
ExplicitAPI should be added in the kmp shared template project by default
d
This is pretty cool! I visualized the dependencies between classes to easier understand how to reduce the header!
very nice 1