I'd like to have a way to stop changes to certain properties or relationships from causing an object to be marked as updated in a notification.
I have a User model with two properties, name: String and retrievedAt: NSDate. The UI is setup to only show the name. When a network request is done to get the users, retrievedAt will be updated and cause the UI to update even though nothing in the UI needs to change.
Add a method to Object that can be overridden to provide properties that shouldn't cause an updated notification. This is the least flexible option since it would be set at the class level.
Add a property to addNotificationBlock that takes some kind of settings object that you can set properties that should be ignored.
Add a property to RealmCollectionChange or Object to find out what properties were changed to cause the update and allow the user to ignore them as needed.
Create a new object UserHousekeeping that contains the retrievedAt: NSDate and a relationship to the User. User then needs to use a LinkingObjects to have a reference to the UserHousekeeping without having notifications be created for changes to the related object.
The initial design proposal for change notifications had something like addNotificationBlock:watchingKeyPaths: which would make it only report modifications for the specified keypaths. This turned out to be nontrivial to implement (currently the information about which property changed is discarded long before any of the per-notification-block logic), but I think it's still high on the list of things we'd like to add to change notifications.
+1
I think it's still high on the list of things we'd like to add to change notifications.
Excellent!
Add a method to Object that can be overridden to provide properties that shouldn't cause an updated notification. This is the least flexible option since it would be set at the class level.
Just my 2 cents: I would rather not have this feature at all, than have it implemented in this inflexible manner. I already have use cases where I need notifications for specific related object changes in one view controller, and not in another view controller.
Finally, I propose that instead of telling it what keypaths to watch, we tell it what keypaths to ignore, so a method like:addNotificationBlock:ignoringKeyPaths:.
Hopefully this feedback is useful.
need +1
+1
Any news on this one?
We'll post any developments regarding this issue, in this issue.
+1
+1
+1
+1
+1
+1111111111111
+1
+1
+1
+1
+1?
I really need this!
Is there some kind of roadmap for what features will be worked on when? It seems like this has been open for 2 years? I too need this desperately !
+1
+1
Most helpful comment
+1
Excellent!
Just my 2 cents: I would rather not have this feature at all, than have it implemented in this inflexible manner. I already have use cases where I need notifications for specific related object changes in one view controller, and not in another view controller.
Finally, I propose that instead of telling it what keypaths to watch, we tell it what keypaths to ignore, so a method like:
addNotificationBlock:ignoringKeyPaths:.Hopefully this feedback is useful.