{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/36029244","id":36029244,"diff_hunk":"@@ -0,0 +1,203 @@\n+////////////////////////////////////////////////////////////////////////////\n+//\n+// Copyright 2014 Realm Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+// http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+//\n+////////////////////////////////////////////////////////////////////////////\n+\n+import Foundation\n+import Realm\n+\n+/**\n+Encapsulates iteration state and interface for iteration over a\n+`RealmCollectionType`.\n+*/\n+public class RLMGenerator<T: Object>: GeneratorType {\n+    private let generatorBase: NSFastGenerator\n+\n+    internal init(collection: RLMCollection) {\n+        generatorBase = NSFastGenerator(collection)\n+    }\n+\n+    /// Advance to the next element and return it, or `nil` if no next element\n+    /// exists.\n+    public func next() -> T? {\n+        let accessor = generatorBase.next() as! T?\n+        if let accessor = accessor {\n+            RLMInitializeSwiftListAccessor(accessor)\n+        }\n+        return accessor\n+    }\n+}\n+\n+/**\n+A homogenous collection of `Object`s which can be retrieved, filtered, sorted,\n+and operated upon.\n+*/\n+public protocol RealmCollectionType: CollectionType {\n+\n+    /// Element type contained in this collection.\n+    typealias Element: Object","path":"RealmSwift-swift1.2/RealmCollectionType.swift","position":51,"original_position":51,"commit_id":"1a80f3d1cd2d96e09f82905976e00285f9a5b632","original_commit_id":"1a80f3d1cd2d96e09f82905976e00285f9a5b632","user":{"login":"segiddins","id":1946610,"avatar_url":"https://avatars.githubusercontent.com/u/1946610?v=3","gravatar_id":"","url":"https://api.github.com/users/segiddins","html_url":"https://github.com/segiddins","followers_url":"https://api.github.com/users/segiddins/followers","following_url":"https://api.github.com/users/segiddins/following{/other_user}","gists_url":"https://api.github.com/users/segiddins/gists{/gist_id}","starred_url":"https://api.github.com/users/segiddins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segiddins/subscriptions","organizations_url":"https://api.github.com/users/segiddins/orgs","repos_url":"https://api.github.com/users/segiddins/repos","events_url":"https://api.github.com/users/segiddins/events{/privacy}","received_events_url":"https://api.github.com/users/segiddins/received_events","type":"User","site_admin":false},"body":"should the type alias be public?","created_at":"2015-08-01T01:56:14Z","updated_at":"2015-08-01T01:56:14Z","html_url":"https://github.com/realm/realm-cocoa/pull/2321#discussion_r36029244","pull_request_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/36029244"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/2321#discussion_r36029244"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321","id":41284767,"html_url":"https://github.com/realm/realm-cocoa/pull/2321","diff_url":"https://github.com/realm/realm-cocoa/pull/2321.diff","patch_url":"https://github.com/realm/realm-cocoa/pull/2321.patch","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2321","number":2321,"state":"open","locked":false,"title":"RealmCollectionType","user":{"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},"body":"/cc @segiddins ","created_at":"2015-07-30T21:34:04Z","updated_at":"2015-08-01T01:56:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c91576a0bf82073d53d9a8dba0dcefad3448618","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321/commits","review_comments_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321/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/2321/comments","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/1a80f3d1cd2d96e09f82905976e00285f9a5b632","head":{"label":"realm:jp-swift-realm-collection","ref":"jp-swift-realm-collection","sha":"1a80f3d1cd2d96e09f82905976e00285f9a5b632","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}","created_at":"2012-04-16T20:06:56Z","updated_at":"2015-08-01T01:03:38Z","pushed_at":"2015-08-01T01:07:37Z","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":116688,"stargazers_count":4381,"watchers_count":4381,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":385,"mirror_url":null,"open_issues_count":142,"forks":385,"open_issues":142,"watchers":4381,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"d71d379391d0402f07f10362e01e4e4b291d09a0","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}","created_at":"2012-04-16T20:06:56Z","updated_at":"2015-08-01T01:03:38Z","pushed_at":"2015-08-01T01:07:37Z","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":116688,"stargazers_count":4381,"watchers_count":4381,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":385,"mirror_url":null,"open_issues_count":142,"forks":385,"open_issues":142,"watchers":4381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/2321"},"issue":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/2321"},"comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/2321/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/2321/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/2321/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-cocoa/statuses/1a80f3d1cd2d96e09f82905976e00285f9a5b632"}}}}