I'm currently building an API library with Kotlin Multiplatform, which I want to share between Android & iOS projects.
API responses, in some cases, contain optionals (which is a great feature of both Kotlin & Swift). For example:
data class User(val name: String, val email: String?)
When building the library for Android (JVM) the optionals are there to works with, when using the iOS Framework inside an iOS project, they are gone because the Framework is exported as an Objective-C framework.
Does anyone know how to either create a Swift framework (is this even possible), or keep the optionals with some sort of workaround? Thanks!
The answer (thanks to @Artyom Degtyarev); this is already the case. Optionals are kept in the Objective-C framework.