I have a kotlin function that uses a default param...
# multiplatform
a
I have a kotlin function that uses a default parameter value. Is there any way of using this in the generated ios/swift code?
h
Nope, because Kotlin exports an objective c framework, which does not support default values. Swift uses the objective c framework, there is no direct swift code generation.
a
Thanks again. And damn. I'll need to think of some new ways of passing default dispatchers to functions and the like
alternatively,
Copy code
class MyClass {
    suspend fun doSomething(dispatcher: CoroutineDispatcher) {
        // doing something
        withContext(dispatcher) {
        }
    }

    suspend fun doSomething() {
        doSomething(Dispathcers.Default)
    }
}
a
Nice idea thanks. I actually found a dispatcher I can use in ios, but that looks like a good solution too