Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 581 Bytes

Read-only member properties.md

File metadata and controls

29 lines (19 loc) · 581 Bytes

Read-only member properties

Member val property is accessible from Swift and is a read-only property in Swift.

Explanations

Let's declare a simple class on the Kotlin code side:

class UsualClassValProperty(
    val param: String
) {
    
    val property: String get() = "123"
    
}

On the Swift side, we can access both the fields declared in the constructor and the properties declared inside the class:

let myClass = UsualClassValProperty(param: "123")

let _ = myClass.param
let _ = myClass.property

Table of contents