Hello all :wave: I need to use a function that I’...
# multiplatform
n
Hello all 👋 I need to use a function that I’ve declared in iosMain which takes varargs Any parameters, from my Swift code. Do you know how can I do it?
a
Hi, When i created a function which takes vararg any as parameter seems like it turns into KotlinArray on Objective-C side. So you can call that method like someClassWithMethod.logVararg(data: KotlinArray<AnyObject>.*init*(size: 5, init: { index in             ("Test-" + index.stringValue) as AnyObject           }))
In my opinion for situiation, its better to use Array as input instead of varargs on the multiplatform side
n
Thank you for your response but MutableList<Any?> in the multiplatform side also worked
a
Yes its also ok 👍