Thread
#multiplatform
    Charles Prado

    Charles Prado

    1 year ago
    There's any way to make iOS headers understand default properties set on the Kotlin side? In Kotlin I have this class:
    @Serializable
    @Parcelize
    data class SomeClass(
        val id: String = "",
        val name: String = "",
        val mandatory1: String,
        val mandatory2: String,
    )
    On the iOS side, what I want is:
    // SomeiOSClass.swift 
    let instance = SomeClass(mandatory1: "foo", mandatory2: "bar")
    instead of :
    // SomeiOSClass.swift 
    let instance = SomeClass(id: "someId", name: "someName", mandatory1: "foo", mandatory2: "bar")
    Is it possible to not have to set those properties that already have a default value defined on Kotlin's side?
    e

    ephemient

    1 year ago
    no, because K/N interop is at the Objective-C level, which doesn't support default args
    Charles Prado

    Charles Prado

    1 year ago
    I imagined that could be the reason 😅
    e

    ephemient

    1 year ago
    if there were something equivalent to
    @JvmOverloads
    that might help, but there isn't, https://youtrack.jetbrains.com/issue/KT-38685
    xxfast

    xxfast

    1 year ago
    same goes for the
    copy()
    function i guess