ObjCEnum

expect annotation class ObjCEnum(val name: String = "", val swiftName: String = "")(source)

Instructs the Kotlin compiler to generate a NS_ENUM typedef for the annotated enum class. The name of the generated type will be the name of the enum type with "NSEnum" appended. This name can be overridden with the "name" parameter, which is treated as an exact name. Additionally, a separate name for Swift can be specified using the swiftName parameter. The enum literals will be prefixed with the type name, as they live in a global namespace. Swift naming will remove these disambiguation prefixes. The NSEnum values are accessible via the "nsEnum" property.

Since Kotlin

2.3
actual annotation class ObjCEnum(val name: String = "", val swiftName: String = "")(source)

Instructs the Kotlin compiler to generate a NS_ENUM typedef for the annotated enum class. The name of the generated type will be the name of the enum type with "NSEnum" appended. This name can be overridden with the "name" parameter, which is treated as an exact name. Additionally, a separate name for Swift can be specified using the swiftName parameter. The enum literals will be prefixed with the type name, as they live in a global namespace. Swift naming will remove these disambiguation prefixes. The NSEnum values are accessible via the "nsEnum" property.

Since Kotlin

2.3

Properties

Link copied to clipboard
expect val name: String
Since Kotlin 2.3
actual val name: String
Since Kotlin 2.3
Link copied to clipboard
expect val swiftName: String
Since Kotlin 2.3
actual val swiftName: String
Since Kotlin 2.3