class GetDetailsAction(private val repository: Repository = DefaultRepository()) {
// code here
}
It would be great to be to use default arguments in constructor/function in Kotlin Multiplatform common code and be able to replace them in Swift.
I know that we don’t have default arguments in Objective C framework that is used in Swift, in this case maybe we can use something like @SwiftOverloading
annotation like for JVM or something different?
For now I should write additional constructors and function in common code and it’s a lot of code…
And the questions are:
- It is planned to add a more beautiful solution than manual writing overloaded constructor / function?
- What is the best solution for handling optional params in Kotlin Multiplatform project for Android / iOS / Web platforms for now?
Thanks