-
Notifications
You must be signed in to change notification settings - Fork 923
Custom NSKeyValueObservingOptions to add FBKVONotificationKeyPathKey #126
base: master
Are you sure you want to change the base?
Conversation
@drkibitz This change looks great, with one exception: extending an existing bitmask. I am very curious about exploring other possibilities to accomplish the same... The easiest solution that comes to my mind: have another bitmask of options and a set of methods to support them? Thoughts? Anything else that we can use to achieve the same? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting per-discussion re: long-term stability.
@nlutsenko 4 ideas, the first I almost submitted as this PR, but went with what you already reviewed instead 😉
Ok 5, which can be a combination of 1 and 4. Meaning new methods, but only current public methods that deal with multiple keyPaths internally pass the custom option flag turned on, while methods dealing with a single keyPath do not bother and just leave it off. What do you think? |
@nlutsenko ping, for previous comment |
This PR might be a little "iffy", but based on a comment I made here, I thought I'd give it a shot.
My reasoning (as in that comment), is that I'm a little skittish in updating from my hash I am using for this project, as I use KVO a lot, and wondering if creating mutable copies of the change dictionary for a particular use case impacts performance measurably for someone like me, and if it is necessary for many use cases like mine (I haven't needed this yet in my usage).
The "iffy" part of course is adding a new option to an existing Foundation enum. Though I actually don't mind it all that much, and does match the functionalities of the other options, in that they add new entries to the change dictionary as well. I also made the option the default when observing more than one keyPath, though this may be problematic, well maybe this whole PR, but still looking forward to some feedback anyway. Thanks in advance!