Custom delegation
suggest changeclass MyDelegate {
operator fun getValue(owner: Any?, property: KProperty<*>): String {
return "Delegated value"
}
}
val foo : String by MyDelegate()
println(foo)
The example prints Delegated value
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents