Hello! Fast question. It's possible to use Kotlin reflection in Kotlin Multiplatform? Only from common module, not on iOS or Android.
Building at this moment a wrapper over Firebase Firestore and I want to cast a convert a class to a
Map<Field,Value>
for pass it to iOS library.
g
gildor
10/17/2019, 10:27 AM
No, reflections are available only on JVM
gildor
10/17/2019, 10:28 AM
But probably kotlinx.serialization may help somehow in your case
f
FranGSierra
10/17/2019, 10:28 AM
Gonna check that then
g
gildor
10/17/2019, 10:30 AM
Iโm not sure about particular approach, and itโs not exactly how it works, but it created to generate bytecode that provides mapping function for serialization formats (so probably output maybe also Map)
f
FranGSierra
10/17/2019, 10:36 AM
Great, gonna investigate about it ๐ If it works as common serialization it should not be really hard. My other approach was going to have a
Serializable
interface applied to the models with a
toMap
fromMap
methods ๐
FranGSierra
10/17/2019, 10:36 AM
So if this works it will save me a lot of boilerplate ๐ thank you so much @gildor