How can I access the swift `JsonEncoder` and `Json...
# kotlin-native
a
How can I access the swift
JsonEncoder
and
JsonDecoder
in Kotlin native? I noticed a JsonDecoder in Mapkit but can't see the Encoder in the same package.
r
If these are pure Swift APIs, you can’t use them in Kotlin. You can only use Objective-C APIs in Kotlin.
Looks like pure Swift (can’t select Objective-C as language in the top right corner) https://developer.apple.com/documentation/foundation/jsonencoder
If you want to do Json in Kotlin/Native you should use kotlinx.serialization
a
Thanks @ribesg