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
Ahmet Özcan
12/16/2021, 6:59 AM
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
}))
Ahmet Özcan
12/16/2021, 7:02 AM
In my opinion for situiation, its better to use Array as input instead of varargs on the multiplatform side
n
Nilay Dağdemir
12/16/2021, 10:26 AM
Thank you for your response but MutableList<Any?> in the multiplatform side also worked