{"action":"created","issue":{"url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/18","labels_url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/18/comments","events_url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/18/events","html_url":"https://github.com/Raizlabs/RZDataBinding/issues/18","id":60744762,"number":18,"title":"Helper macro for `keyPathsForValuesAffecting`","user":{"login":"KingOfBrian","id":114322,"avatar_url":"https://avatars.githubusercontent.com/u/114322?v=3","gravatar_id":"","url":"https://api.github.com/users/KingOfBrian","html_url":"https://github.com/KingOfBrian","followers_url":"https://api.github.com/users/KingOfBrian/followers","following_url":"https://api.github.com/users/KingOfBrian/following{/other_user}","gists_url":"https://api.github.com/users/KingOfBrian/gists{/gist_id}","starred_url":"https://api.github.com/users/KingOfBrian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KingOfBrian/subscriptions","organizations_url":"https://api.github.com/users/KingOfBrian/orgs","repos_url":"https://api.github.com/users/KingOfBrian/repos","events_url":"https://api.github.com/users/KingOfBrian/events{/privacy}","received_events_url":"https://api.github.com/users/KingOfBrian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-11T23:03:52Z","updated_at":"2015-03-18T17:49:56Z","closed_at":null,"body":"I find myself writing this a lot:\r\n```objc\r\n+ (NSSet *)keyPathsForValuesAffectingMyKeyPath\r\n{\r\n    return [NSSet setWithObjects:\r\n            RZDB_KP(ClassName, self.key.path.1),\r\n            RZDB_KP(ClassNmae, self.key.path.2),\r\n            nil];\r\n}\r\n```\r\n\r\nIt would be awesome to have a macro that would:\r\n\r\n```objc\r\nRZDB_KEYPATHS_AFFECTING( MyKeyPath, ClassName, self.key.path.1, self.key.path.2)\r\n```"},"comment":{"url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/comments/83088865","html_url":"https://github.com/Raizlabs/RZDataBinding/issues/18#issuecomment-83088865","issue_url":"https://api.github.com/repos/Raizlabs/RZDataBinding/issues/18","id":83088865,"user":{"login":"jvisenti","id":1039147,"avatar_url":"https://avatars.githubusercontent.com/u/1039147?v=3","gravatar_id":"","url":"https://api.github.com/users/jvisenti","html_url":"https://github.com/jvisenti","followers_url":"https://api.github.com/users/jvisenti/followers","following_url":"https://api.github.com/users/jvisenti/following{/other_user}","gists_url":"https://api.github.com/users/jvisenti/gists{/gist_id}","starred_url":"https://api.github.com/users/jvisenti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvisenti/subscriptions","organizations_url":"https://api.github.com/users/jvisenti/orgs","repos_url":"https://api.github.com/users/jvisenti/repos","events_url":"https://api.github.com/users/jvisenti/events{/privacy}","received_events_url":"https://api.github.com/users/jvisenti/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T17:49:56Z","updated_at":"2015-03-18T17:49:56Z","body":"After actually implementing this, it looks like:\r\n```\r\n#define RZDB_KEYPATHS_AFFECTING(CapitalizedKeyPath, ...) \\\r\n+ (NSSet *)keyPathsForValuesAffecting##CapitalizedKeyPath \\\r\n{ \\\r\n    return [NSSet setWithObjects:__VA_ARGS__, nil]; \\\r\n}\r\n```\r\nUsage:\r\n`RZDB_KEYPATHS_AFFECTING(MyKeyPath, RZDB_KP(MyClass, affectingKeyPath), ...)`"}}