https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
x

Xavier Lian

09/29/2019, 4:35 PM
Does multiplatform not support default parmeters in iOS? Kotlin:
Copy code
class MyClass(val myParam: String = "default string")
{
    fun printStuff()
    {
        println(myParam)
    }
}
iOS:
Copy code
let myClass = MyClass()    //Compiler error: init() is unavailable
🚫 1
b

basher

09/29/2019, 4:47 PM
Obj-C doesn’t have that language feature
Best they could do is generate 2 methods (one with and without the arg)
Looks like they're not doing that though :)
x

Xavier Lian

09/30/2019, 5:00 AM
Ok, thank you