Joshua Hansen
10/22/2025, 6:32 PMclass Foo {
var number: Int = 0
}
Is it possible to pass a reference to the number property to another class so that the other class can reassign it?Michael Krussel
10/22/2025, 6:49 PMKMutableProperty1 to a function and get an instance of from ::number.
You can also access the setter from it pass it somewhere as a Function.Stephan Schröder
10/22/2025, 7:21 PMval foo = Foo()
val setter: (Int)->Unit = { newValue -> foo.number = newValue }
class Bar( val setNumber: (Int)->Unit )
val bar = Bar(setter)