Adrien Giboire Adrien Giboire - 6 months ago 3x
Swift Question

How to set watchers on Realm model?

For debugging purposes, I would like to set watchers/observers on models but I didn't find hint so far.

Notice I'm rather new in iOS development (less than a month) so I might be missing something.


If you want to observe a whole class of objects, you can make a query, apply filters and then observe these Results for Notifications.

If you want to observe changes to a single object, you can retrieve it and then observe the properties you're interested in via Key-Value Observation (KVO).