{"action":"created","comment":{"url":"https://api.github.com/repos/hyperoslo/Spots/pulls/comments/46479206","id":46479206,"diff_hunk":"@@ -83,7 +83,13 @@ public class SpotsController: UIViewController {\n   }\n \n   public func spotAtIndex(index: Int) -> Spotable? {\n-    return spots.filter { $0.index == index }.first\n+    return spots.filter{ $0.index == index }.first\n+  }\n+\n+  public func spot(closure: (index: Int, spot: Spotable) -> Bool) -> Spotable? {\n+    for (index, spot) in spots.enumerate() where closure(index: index, spot: spot)","path":"Source/SpotsController.swift","position":9,"original_position":9,"commit_id":"02276ec50daf6358c610df4aac58c4173f529df0","original_commit_id":"02276ec50daf6358c610df4aac58c4173f529df0","user":{"login":"zenangst","id":57446,"avatar_url":"https://avatars.githubusercontent.com/u/57446?v=3","gravatar_id":"","url":"https://api.github.com/users/zenangst","html_url":"https://github.com/zenangst","followers_url":"https://api.github.com/users/zenangst/followers","following_url":"https://api.github.com/users/zenangst/following{/other_user}","gists_url":"https://api.github.com/users/zenangst/gists{/gist_id}","starred_url":"https://api.github.com/users/zenangst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenangst/subscriptions","organizations_url":"https://api.github.com/users/zenangst/orgs","repos_url":"https://api.github.com/users/zenangst/repos","events_url":"https://api.github.com/users/zenangst/events{/privacy}","received_events_url":"https://api.github.com/users/zenangst/received_events","type":"User","site_admin":false},"body":"Looked a little weird because of the Xcode indentation","created_at":"2015-12-02T21:38:35Z","updated_at":"2015-12-02T21:38:35Z","html_url":"https://github.com/hyperoslo/Spots/pull/76#discussion_r46479206","pull_request_url":"https://api.github.com/repos/hyperoslo/Spots/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/comments/46479206"},"html":{"href":"https://github.com/hyperoslo/Spots/pull/76#discussion_r46479206"},"pull_request":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/hyperoslo/Spots/pulls/76","id":52457255,"html_url":"https://github.com/hyperoslo/Spots/pull/76","diff_url":"https://github.com/hyperoslo/Spots/pull/76.diff","patch_url":"https://github.com/hyperoslo/Spots/pull/76.patch","issue_url":"https://api.github.com/repos/hyperoslo/Spots/issues/76","number":76,"state":"open","locked":false,"title":"Feature spot search","user":{"login":"zenangst","id":57446,"avatar_url":"https://avatars.githubusercontent.com/u/57446?v=3","gravatar_id":"","url":"https://api.github.com/users/zenangst","html_url":"https://github.com/zenangst","followers_url":"https://api.github.com/users/zenangst/followers","following_url":"https://api.github.com/users/zenangst/following{/other_user}","gists_url":"https://api.github.com/users/zenangst/gists{/gist_id}","starred_url":"https://api.github.com/users/zenangst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenangst/subscriptions","organizations_url":"https://api.github.com/users/zenangst/orgs","repos_url":"https://api.github.com/users/zenangst/repos","events_url":"https://api.github.com/users/zenangst/events{/privacy}","received_events_url":"https://api.github.com/users/zenangst/received_events","type":"User","site_admin":false},"body":"This PR adds an easier way of searching for spots, instead of just referencing the ID, you are free to construct your own query with a closure;\r\n\r\n```swift\r\n    .spot { $1.component.title == \"ListSpot\" }\r\n    .spot { $1 is Listable }\r\n    .spot { $1.items.filter{ $0.title == \"ListItem\" }.first != nil }\r\n    .spot { $0.index == 0 }?.component.title, \"ListSpot\"\r\n```","created_at":"2015-12-02T21:32:45Z","updated_at":"2015-12-02T21:38:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9264a85882b87cd85802f57b3670ef62fc2f0cf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hyperoslo/Spots/pulls/76/commits","review_comments_url":"https://api.github.com/repos/hyperoslo/Spots/pulls/76/comments","review_comment_url":"https://api.github.com/repos/hyperoslo/Spots/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperoslo/Spots/issues/76/comments","statuses_url":"https://api.github.com/repos/hyperoslo/Spots/statuses/02276ec50daf6358c610df4aac58c4173f529df0","head":{"label":"hyperoslo:feature/spot-search","ref":"feature/spot-search","sha":"02276ec50daf6358c610df4aac58c4173f529df0","user":{"login":"hyperoslo","id":1340892,"avatar_url":"https://avatars.githubusercontent.com/u/1340892?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperoslo","html_url":"https://github.com/hyperoslo","followers_url":"https://api.github.com/users/hyperoslo/followers","following_url":"https://api.github.com/users/hyperoslo/following{/other_user}","gists_url":"https://api.github.com/users/hyperoslo/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperoslo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperoslo/subscriptions","organizations_url":"https://api.github.com/users/hyperoslo/orgs","repos_url":"https://api.github.com/users/hyperoslo/repos","events_url":"https://api.github.com/users/hyperoslo/events{/privacy}","received_events_url":"https://api.github.com/users/hyperoslo/received_events","type":"Organization","site_admin":false},"repo":{"id":43603611,"name":"Spots","full_name":"hyperoslo/Spots","owner":{"login":"hyperoslo","id":1340892,"avatar_url":"https://avatars.githubusercontent.com/u/1340892?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperoslo","html_url":"https://github.com/hyperoslo","followers_url":"https://api.github.com/users/hyperoslo/followers","following_url":"https://api.github.com/users/hyperoslo/following{/other_user}","gists_url":"https://api.github.com/users/hyperoslo/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperoslo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperoslo/subscriptions","organizations_url":"https://api.github.com/users/hyperoslo/orgs","repos_url":"https://api.github.com/users/hyperoslo/repos","events_url":"https://api.github.com/users/hyperoslo/events{/privacy}","received_events_url":"https://api.github.com/users/hyperoslo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperoslo/Spots","description":"","fork":false,"url":"https://api.github.com/repos/hyperoslo/Spots","forks_url":"https://api.github.com/repos/hyperoslo/Spots/forks","keys_url":"https://api.github.com/repos/hyperoslo/Spots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperoslo/Spots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperoslo/Spots/teams","hooks_url":"https://api.github.com/repos/hyperoslo/Spots/hooks","issue_events_url":"https://api.github.com/repos/hyperoslo/Spots/issues/events{/number}","events_url":"https://api.github.com/repos/hyperoslo/Spots/events","assignees_url":"https://api.github.com/repos/hyperoslo/Spots/assignees{/user}","branches_url":"https://api.github.com/repos/hyperoslo/Spots/branches{/branch}","tags_url":"https://api.github.com/repos/hyperoslo/Spots/tags","blobs_url":"https://api.github.com/repos/hyperoslo/Spots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperoslo/Spots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperoslo/Spots/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperoslo/Spots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperoslo/Spots/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperoslo/Spots/languages","stargazers_url":"https://api.github.com/repos/hyperoslo/Spots/stargazers","contributors_url":"https://api.github.com/repos/hyperoslo/Spots/contributors","subscribers_url":"https://api.github.com/repos/hyperoslo/Spots/subscribers","subscription_url":"https://api.github.com/repos/hyperoslo/Spots/subscription","commits_url":"https://api.github.com/repos/hyperoslo/Spots/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperoslo/Spots/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperoslo/Spots/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperoslo/Spots/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperoslo/Spots/contents/{+path}","compare_url":"https://api.github.com/repos/hyperoslo/Spots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperoslo/Spots/merges","archive_url":"https://api.github.com/repos/hyperoslo/Spots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperoslo/Spots/downloads","issues_url":"https://api.github.com/repos/hyperoslo/Spots/issues{/number}","pulls_url":"https://api.github.com/repos/hyperoslo/Spots/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperoslo/Spots/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperoslo/Spots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperoslo/Spots/labels{/name}","releases_url":"https://api.github.com/repos/hyperoslo/Spots/releases{/id}","created_at":"2015-10-03T15:28:33Z","updated_at":"2015-11-25T14:48:04Z","pushed_at":"2015-12-02T21:33:22Z","git_url":"git://github.com/hyperoslo/Spots.git","ssh_url":"git@github.com:hyperoslo/Spots.git","clone_url":"https://github.com/hyperoslo/Spots.git","svn_url":"https://github.com/hyperoslo/Spots","homepage":null,"size":783,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"hyperoslo:master","ref":"master","sha":"916e2a5f426cb72be3c587da1646ec7da945ce04","user":{"login":"hyperoslo","id":1340892,"avatar_url":"https://avatars.githubusercontent.com/u/1340892?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperoslo","html_url":"https://github.com/hyperoslo","followers_url":"https://api.github.com/users/hyperoslo/followers","following_url":"https://api.github.com/users/hyperoslo/following{/other_user}","gists_url":"https://api.github.com/users/hyperoslo/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperoslo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperoslo/subscriptions","organizations_url":"https://api.github.com/users/hyperoslo/orgs","repos_url":"https://api.github.com/users/hyperoslo/repos","events_url":"https://api.github.com/users/hyperoslo/events{/privacy}","received_events_url":"https://api.github.com/users/hyperoslo/received_events","type":"Organization","site_admin":false},"repo":{"id":43603611,"name":"Spots","full_name":"hyperoslo/Spots","owner":{"login":"hyperoslo","id":1340892,"avatar_url":"https://avatars.githubusercontent.com/u/1340892?v=3","gravatar_id":"","url":"https://api.github.com/users/hyperoslo","html_url":"https://github.com/hyperoslo","followers_url":"https://api.github.com/users/hyperoslo/followers","following_url":"https://api.github.com/users/hyperoslo/following{/other_user}","gists_url":"https://api.github.com/users/hyperoslo/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperoslo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperoslo/subscriptions","organizations_url":"https://api.github.com/users/hyperoslo/orgs","repos_url":"https://api.github.com/users/hyperoslo/repos","events_url":"https://api.github.com/users/hyperoslo/events{/privacy}","received_events_url":"https://api.github.com/users/hyperoslo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyperoslo/Spots","description":"","fork":false,"url":"https://api.github.com/repos/hyperoslo/Spots","forks_url":"https://api.github.com/repos/hyperoslo/Spots/forks","keys_url":"https://api.github.com/repos/hyperoslo/Spots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperoslo/Spots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperoslo/Spots/teams","hooks_url":"https://api.github.com/repos/hyperoslo/Spots/hooks","issue_events_url":"https://api.github.com/repos/hyperoslo/Spots/issues/events{/number}","events_url":"https://api.github.com/repos/hyperoslo/Spots/events","assignees_url":"https://api.github.com/repos/hyperoslo/Spots/assignees{/user}","branches_url":"https://api.github.com/repos/hyperoslo/Spots/branches{/branch}","tags_url":"https://api.github.com/repos/hyperoslo/Spots/tags","blobs_url":"https://api.github.com/repos/hyperoslo/Spots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperoslo/Spots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperoslo/Spots/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperoslo/Spots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperoslo/Spots/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperoslo/Spots/languages","stargazers_url":"https://api.github.com/repos/hyperoslo/Spots/stargazers","contributors_url":"https://api.github.com/repos/hyperoslo/Spots/contributors","subscribers_url":"https://api.github.com/repos/hyperoslo/Spots/subscribers","subscription_url":"https://api.github.com/repos/hyperoslo/Spots/subscription","commits_url":"https://api.github.com/repos/hyperoslo/Spots/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperoslo/Spots/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperoslo/Spots/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperoslo/Spots/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperoslo/Spots/contents/{+path}","compare_url":"https://api.github.com/repos/hyperoslo/Spots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperoslo/Spots/merges","archive_url":"https://api.github.com/repos/hyperoslo/Spots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperoslo/Spots/downloads","issues_url":"https://api.github.com/repos/hyperoslo/Spots/issues{/number}","pulls_url":"https://api.github.com/repos/hyperoslo/Spots/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperoslo/Spots/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperoslo/Spots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperoslo/Spots/labels{/name}","releases_url":"https://api.github.com/repos/hyperoslo/Spots/releases{/id}","created_at":"2015-10-03T15:28:33Z","updated_at":"2015-11-25T14:48:04Z","pushed_at":"2015-12-02T21:33:22Z","git_url":"git://github.com/hyperoslo/Spots.git","ssh_url":"git@github.com:hyperoslo/Spots.git","clone_url":"https://github.com/hyperoslo/Spots.git","svn_url":"https://github.com/hyperoslo/Spots","homepage":null,"size":783,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/76"},"html":{"href":"https://github.com/hyperoslo/Spots/pull/76"},"issue":{"href":"https://api.github.com/repos/hyperoslo/Spots/issues/76"},"comments":{"href":"https://api.github.com/repos/hyperoslo/Spots/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperoslo/Spots/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/hyperoslo/Spots/statuses/02276ec50daf6358c610df4aac58c4173f529df0"}}}}