{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/61161584","id":61161584,"diff_hunk":"@@ -92,4 +97,17 @@ RLM_ASSUME_NONNULL_BEGIN\n \n @end\n \n+\n+/**\n+ This class describes a specific property on a given class.\n+ */\n+@interface RLMPropertyDescriptor : NSObject\n+\n++ (instancetype)descriptorWithClass:(Class)objectClass propertyName:(NSString *)propertyName;","path":"Realm/RLMProperty.h","position":22,"original_position":22,"commit_id":"e861d1a228e520c9e27c2e8e61d544612f8b183d","original_commit_id":"e861d1a228e520c9e27c2e8e61d544612f8b183d","user":{"login":"bdash","id":54825,"avatar_url":"https://avatars.githubusercontent.com/u/54825?v=3","gravatar_id":"","url":"https://api.github.com/users/bdash","html_url":"https://github.com/bdash","followers_url":"https://api.github.com/users/bdash/followers","following_url":"https://api.github.com/users/bdash/following{/other_user}","gists_url":"https://api.github.com/users/bdash/gists{/gist_id}","starred_url":"https://api.github.com/users/bdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdash/subscriptions","organizations_url":"https://api.github.com/users/bdash/orgs","repos_url":"https://api.github.com/users/bdash/repos","events_url":"https://api.github.com/users/bdash/events{/privacy}","received_events_url":"https://api.github.com/users/bdash/received_events","type":"User","site_admin":false},"body":"Swift generates warnings since it doesn't consider properties to have selectors:\r\n```\r\nexamples/ios/swift-2.2/Backlink/AppDelegate.swift:27:75: warning: no method declared with Objective-C selector 'dogs'\r\n    let owners = LinkingObjects(fromType: Person.self, property: Selector(\"dogs\"))\r\n```","created_at":"2016-04-26T20:49:32Z","updated_at":"2016-04-26T20:49:32Z","html_url":"https://github.com/realm/realm-cocoa/pull/3419#discussion_r61161584","pull_request_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/61161584"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/3419#discussion_r61161584"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419","id":65713146,"html_url":"https://github.com/realm/realm-cocoa/pull/3419","diff_url":"https://github.com/realm/realm-cocoa/pull/3419.diff","patch_url":"https://github.com/realm/realm-cocoa/pull/3419.patch","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3419","number":3419,"state":"open","locked":false,"title":"Add support for linking objects properties","user":{"login":"bdash","id":54825,"avatar_url":"https://avatars.githubusercontent.com/u/54825?v=3","gravatar_id":"","url":"https://api.github.com/users/bdash","html_url":"https://github.com/bdash","followers_url":"https://api.github.com/users/bdash/followers","following_url":"https://api.github.com/users/bdash/following{/other_user}","gists_url":"https://api.github.com/users/bdash/gists{/gist_id}","starred_url":"https://api.github.com/users/bdash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdash/subscriptions","organizations_url":"https://api.github.com/users/bdash/orgs","repos_url":"https://api.github.com/users/bdash/repos","events_url":"https://api.github.com/users/bdash/events{/privacy}","received_events_url":"https://api.github.com/users/bdash/received_events","type":"User","site_admin":false},"body":"Linking objects properties provide a live view on which objects have a given relationship with an object:\r\n```swift\r\nclass Person: Object {\r\n    dynamic var name = \"\"\r\n    dynamic var age = 0\r\n    let children = List<Person>()\r\n    let parents = LinkingObjects(fromType: Person.self, property: \"children\")\r\n}\r\n```\r\n\r\nThey're an improvement over the existing `Object.linkingObjects(_:forProperty:)` in three key ways:\r\n\r\n1. They're a live, automatically updating view, rather than a point in time snapshot.\r\n2. They can be used in queries:\r\n\r\n    ```swift\r\n    // People that have a child that have a parent named Diane.\r\n    realm.objects(Person).filter(\"ANY children.parents.name == 'Diane'\")\r\n    ```\r\n3. `LinkingObjects` is a subclass of `Results` and so supports all of methods you'd expect:\r\n\r\n    ```swift\r\n    // Which of my parents are over the age of 56?\r\n    bdash.parents.filter(\"age > 56\")\r\n    \r\n    // Calculate the age of my parents.\r\n    bdash.parents.average(\"age\")\r\n    ```\r\n\r\nFixes #1324.\r\n\r\nThis depends on an unreleased version of Realm core.\r\n\r\nRemaining work:\r\n- [x] Schema validation to ensure that the specified class and property links to this object.\r\n- [x] Notifications? I think these should work out of the box, but need tests to verify.\r\n- [x] More testing of the non-query aspects.\r\n\r\nOutstanding issues:\r\n- [x] Objective-C `RLMLinkingObjects` properties are `nil` for standalone objects, but Swift `LinkingObjects` cannot be. How should we reconcile this?\r\n- [ ] Do we need to support KVO on linking objects properties in the initial implementation?\r\n- [x] Is there a nicer way to declare the properties in Objective-C?\r\n- [ ] Is it ok to make `Results` non-final? Can we avoid it?\r\n- [x] What should we do with `Object.linkingObjects(_:forProperty:)`?","created_at":"2016-04-07T22:55:56Z","updated_at":"2016-04-26T20:49:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5298610edcbf6398d238b6b98a4c04ce3f0cc12a","assignee":null,"milestone":{"url":"https://api.github.com/repos/realm/realm-cocoa/milestones/11","html_url":"https://github.com/realm/realm-cocoa/milestones/0.100","labels_url":"https://api.github.com/repos/realm/realm-cocoa/milestones/11/labels","id":1716958,"number":11,"title":"0.100","description":"","creator":{"login":"jpsim","id":474794,"avatar_url":"https://avatars.githubusercontent.com/u/474794?v=3","gravatar_id":"","url":"https://api.github.com/users/jpsim","html_url":"https://github.com/jpsim","followers_url":"https://api.github.com/users/jpsim/followers","following_url":"https://api.github.com/users/jpsim/following{/other_user}","gists_url":"https://api.github.com/users/jpsim/gists{/gist_id}","starred_url":"https://api.github.com/users/jpsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpsim/subscriptions","organizations_url":"https://api.github.com/users/jpsim/orgs","repos_url":"https://api.github.com/users/jpsim/repos","events_url":"https://api.github.com/users/jpsim/events{/privacy}","received_events_url":"https://api.github.com/users/jpsim/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2016-04-19T13:19:27Z","updated_at":"2016-04-26T08:41:09Z","due_on":"2016-04-26T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419/commits","review_comments_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419/comments","review_comment_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3419/comments","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/e861d1a228e520c9e27c2e8e61d544612f8b183d","head":{"label":"realm:mar/linking-objects","ref":"mar/linking-objects","sha":"e861d1a228e520c9e27c2e8e61d544612f8b183d","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4044891,"name":"realm-cocoa","full_name":"realm/realm-cocoa","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-cocoa","description":"Realm is a mobile database: a replacement for Core Data & SQLite","fork":false,"url":"https://api.github.com/repos/realm/realm-cocoa","forks_url":"https://api.github.com/repos/realm/realm-cocoa/forks","keys_url":"https://api.github.com/repos/realm/realm-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-cocoa/teams","hooks_url":"https://api.github.com/repos/realm/realm-cocoa/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-cocoa/events","assignees_url":"https://api.github.com/repos/realm/realm-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-cocoa/tags","blobs_url":"https://api.github.com/repos/realm/realm-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-cocoa/languages","stargazers_url":"https://api.github.com/repos/realm/realm-cocoa/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-cocoa/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-cocoa/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-cocoa/subscription","commits_url":"https://api.github.com/repos/realm/realm-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-cocoa/merges","archive_url":"https://api.github.com/repos/realm/realm-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-cocoa/downloads","issues_url":"https://api.github.com/repos/realm/realm-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-cocoa/deployments","created_at":"2012-04-16T20:06:56Z","updated_at":"2016-04-26T14:58:25Z","pushed_at":"2016-04-26T19:34:18Z","git_url":"git://github.com/realm/realm-cocoa.git","ssh_url":"git@github.com:realm/realm-cocoa.git","clone_url":"https://github.com/realm/realm-cocoa.git","svn_url":"https://github.com/realm/realm-cocoa","homepage":"https://realm.io","size":117612,"stargazers_count":7108,"watchers_count":7108,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":728,"mirror_url":null,"open_issues_count":172,"forks":728,"open_issues":172,"watchers":7108,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"44ca31a8fdff27d5f12178d72fdc92b9e0b976f4","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4044891,"name":"realm-cocoa","full_name":"realm/realm-cocoa","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-cocoa","description":"Realm is a mobile database: a replacement for Core Data & SQLite","fork":false,"url":"https://api.github.com/repos/realm/realm-cocoa","forks_url":"https://api.github.com/repos/realm/realm-cocoa/forks","keys_url":"https://api.github.com/repos/realm/realm-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-cocoa/teams","hooks_url":"https://api.github.com/repos/realm/realm-cocoa/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-cocoa/events","assignees_url":"https://api.github.com/repos/realm/realm-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-cocoa/tags","blobs_url":"https://api.github.com/repos/realm/realm-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-cocoa/languages","stargazers_url":"https://api.github.com/repos/realm/realm-cocoa/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-cocoa/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-cocoa/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-cocoa/subscription","commits_url":"https://api.github.com/repos/realm/realm-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-cocoa/merges","archive_url":"https://api.github.com/repos/realm/realm-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-cocoa/downloads","issues_url":"https://api.github.com/repos/realm/realm-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-cocoa/deployments","created_at":"2012-04-16T20:06:56Z","updated_at":"2016-04-26T14:58:25Z","pushed_at":"2016-04-26T19:34:18Z","git_url":"git://github.com/realm/realm-cocoa.git","ssh_url":"git@github.com:realm/realm-cocoa.git","clone_url":"https://github.com/realm/realm-cocoa.git","svn_url":"https://github.com/realm/realm-cocoa","homepage":"https://realm.io","size":117612,"stargazers_count":7108,"watchers_count":7108,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":728,"mirror_url":null,"open_issues_count":172,"forks":728,"open_issues":172,"watchers":7108,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/3419"},"issue":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/3419"},"comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/3419/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3419/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-cocoa/statuses/e861d1a228e520c9e27c2e8e61d544612f8b183d"}}}}