Closures icon indicating copy to clipboard operation
Closures copied to clipboard

is Closures doesn't support custom-observed property in swift ?

Open howoften opened this issue 3 years ago • 1 comments

i define an observed property, and use observe(_, until: _, changeHandler: _) to get value changed callback, most of time it works fine, but in iOS 10.3.3, i receive a crash log! crash description: " *** was deallocated while key value observers were still registered with it";

i declare property like this class Person { @objc dynamic var age: Int = 18 }

howoften avatar Dec 27 '21 01:12 howoften

i notice that you invalidate KeyValueObservation in its changeHandler, is it too late?

howoften avatar Dec 27 '21 02:12 howoften