Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 812 Bytes

Top-level val properties.md

File metadata and controls

26 lines (16 loc) · 812 Bytes

Top-level mutable var properties

You access a top-level property via the wrapper class: TopLevelPropertyKt.topLevelProperty.

Explanations

We describe the top-level val property in Kotlin in file TopLevelProperty.kt:

//TopLevelProperty.kt

val topLevelProperty = "Some value"

In Kotlin, similar code can be called directly, without specifying the file name, just specify import the desired property.

On the Swift side, we get a wrapper class TopLevelPropertyKt (file name in Kotlin + suffix Kt), with which you can access the desired property:

let _ = TopLevelPropertyKt.topLevelProperty

The property is readonly, it cannot be changed.


Table of contents