vhesener / Closures

Swifty closures for UIKit and Foundation
MIT License
1.74k stars 146 forks source link

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

Open howoften opened 2 years ago

howoften commented 2 years ago

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 commented 2 years ago

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