I love this Swift syntax; it's very helpful for many things:
var foo: Bar = Bar() {
willSet {
baz.prepareToDoTheThing()
}
didSet {
baz.doTheThing()
}
}
and I'd love to do this in Kotlin. However, I can't find the proper syntax!
Is there anything in Kotlin like this?
var foo: Bar = Bar()
willSet() {
baz.prepareToDoTheThing()
}
didSet() {
baz.doTheThing()
}