You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Swift, as part of the language, a property can have a didSet and/or willSet. Example:
class A {
var isLocating = false {
didSet {
delegate.set(isLocating: isLocating)
}
}
}
In Kotlin there is no default way of expressing property observers but can be done with delegated properties or by writing a custom setter (https://stackoverflow.com/a/39842353/378433)
For simplicity, implement a custom setter like:
class A {
var isLocating = false
set(value) {
field = value
delegate.set(isLocating = value)
}
}
In case of willSet, just write the code before the field = value assignment
The text was updated successfully, but these errors were encountered:
In Swift, as part of the language, a property can have a
didSet
and/orwillSet
. Example:In Kotlin there is no default way of expressing property observers but can be done with delegated properties or by writing a custom setter (https://stackoverflow.com/a/39842353/378433)
For simplicity, implement a custom setter like:
In case of
willSet
, just write the code before thefield = value
assignmentThe text was updated successfully, but these errors were encountered: