Hey everyone, how can I access `Kotlin enum` from ...
# multiplatform
a
Hey everyone, how can I access
Kotlin enum
from Swift
for example
Copy code
@Parcelize
class ErrorModel(
    val type: Type
) : Parcelable {
    enum class Type {
        NETWORK_ERROR,
        DEFAULT_ERROR
    }
}
a
Type
is not a good name for swift enums as it is reserved keyword. However the enum must be accessible almost as-is:
*let* type = ErrorModel.Type_.defaultError
If not, be sure you properly include the module containing
ErrorModel
class to the KMM build and it appears in iOS framework header file.
a
thank you @Andrei Salavei, it is solved
560 Views