Sign in Go Pro

Kotlin

Delegation Using Delegates.observable

01/31/2018

 

Previous

About

While writing programs, we often need to monitor changes made to the value of a variable. For this purpose, most of the time we implement custom setters and call a function from there, which can make a program quite complex. Fortunately, Kotlin comes to our aid with the `Delegates.observable` delegate, which is, among the standard delegates in Kotlin. In this lesson you will learn: - How the Delegates.observable delegation works - How to monitor a variable with `Delegates.observable` - How to use `Delegates.observable` with custom classes

Instructor

Links

Lessons in Kotlin