Hi, anyone has issues with enum in kotlin? We have...
# multiplatform
h
Hi, anyone has issues with enum in kotlin? We have some enum class defined in kotlin like this
Copy code
enum class AdFormat {
    BANNER,
    NATIVE,
}
However, if we try to access it in swift by
AdFormat.banner
or
.banner
or even
shared.AdFormat.banner
, the compile is fine, but the app crashes immediately with ‘Thread 1: EXC_BAD_ACCESS (code=1, address=0xa8)’ trying to execute this line
d
should it be
BANNER
?
h
The code autocomplete shows banner, besides it also follows the pattern in this dochttps://kotlinlang.org/docs/native-objc-interop.html#enums
Screenshot 2024-06-12 at 11.16.23 AM.png
d
Have you seen skie? That has some enum features for swift/kotlin interop
👀 1
c
Yeah I think thats a bad interopt suggestion, they will hopefully fix this with swift export, but thats a long way out. It should probably be
BANNER
as suggested despite xcode teerrrrrrible suggestions