Custom delegation

suggest change
class MyDelegate {
    operator fun getValue(owner: Any?, property: KProperty<*>): String {
        return "Delegated value"
    }
}

val foo : String by MyDelegate()
println(foo)

The example prints Delegated value

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents