Hi All, Does anyone know if there is documentatio...
# ios
m
Hi All, Does anyone know if there is documentation about the wrapping of Foundation and other iOS system libraries in Kotlin? We currently develop without code-completion, and no reference, so purely trial and error for getting the iOS part of our actual implementation. Any documentation or github page where we can lookup stuff is appreciated.
s
If you’re developing on a Mac using IntelliJ and don’t have completions, there is something wrong with your setup.
m
I am, and I see the same red
platform
imports as Darran Kelinske has posted last tuesday
l
If you use the KMM plugin in Android Studio 4.1+ and try with a new project/module created with the template, you should get autocompletion on a Mac.
m
Yes, we can reproduce that. I don't know what the difference is yet, we have a fairly complicated setup. I will have to dive into this sometime
d
I still have red imports for platform components, but it will build a framework successfully.
I have tried all of the various flags and haven't found success. Still working on it today. Will report back.
t
most reliable method is no HMPP, with only a single iOS target declared.
a
Could you please share the project at kotl.in/issue? At least the Gradle script and environment description.
m
@Artyom Degtyarev [JB] Issue has been created, with minimal project, broken and fixed: https://youtrack.jetbrains.com/issue/KT-43192
👀 1
🙏 3
d
what is hmpp
why did you have to do this - it seems like that should be automatic by the nature of kotlin mp
Copy code
iosMain {
    dependsOn commonMain
}
a
Hello, @dazza5000! HMPP is an abbreviation for hierarchical multiplatform programming. In fact, this is about projects structured as here, not a big difference from an ordinary Kotlin Multiplatform. About explicit dependency on commonMain. As described in the documentation,
dependsOn
relation provide several features, and some of them might not be useful for every new source set. For example, if you want to make a project with hierarchical structure and source sets tree depth more >= 4(e.g.
commonMain
->
nativeMain
for all Native targets ->
appleMain
for Apple subset of Native targets ->
iosX64Main
), I’m not sure making all intermediate source sets depend on the common one is a good idea.