Martin Štrambach
09/26/2022, 11:10 AMclass MyClass {
...
companion object {
fun companionFun()
}
}
When we generate ObjC code out of this example it creates one interface for MyClass
and another one for MyClass.Companion
.
Then, in Swift we use it as MyClass.companion.companionFun()
. The issue is companion
nor companionFun
aren’t static because companion
is a singleton object.
Is there a way how to generate Swift static functions for Kotlin functions without the need of second interface?
I found one feature ticket which would potentially solve this issue but it is without any activity for a long time. https://youtrack.jetbrains.com/issue/KT-44862