{"action":"opened","number":413,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/guides/pulls/413","id":61660807,"html_url":"https://github.com/thoughtbot/guides/pull/413","diff_url":"https://github.com/thoughtbot/guides/pull/413.diff","patch_url":"https://github.com/thoughtbot/guides/pull/413.patch","issue_url":"https://api.github.com/repos/thoughtbot/guides/issues/413","number":413,"state":"open","locked":false,"title":"Add Swift guideline recommending weak references are evaluated once","user":{"login":"sharplet","id":147686,"avatar_url":"https://avatars.githubusercontent.com/u/147686?v=3","gravatar_id":"","url":"https://api.github.com/users/sharplet","html_url":"https://github.com/sharplet","followers_url":"https://api.github.com/users/sharplet/followers","following_url":"https://api.github.com/users/sharplet/following{/other_user}","gists_url":"https://api.github.com/users/sharplet/gists{/gist_id}","starred_url":"https://api.github.com/users/sharplet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharplet/subscriptions","organizations_url":"https://api.github.com/users/sharplet/orgs","repos_url":"https://api.github.com/users/sharplet/repos","events_url":"https://api.github.com/users/sharplet/events{/privacy}","received_events_url":"https://api.github.com/users/sharplet/received_events","type":"User","site_admin":false},"body":"If a weak reference is evaluated multiple times within the same scope, it's technically possible for the reference to change between `nil` and non-`nil` between references. In order to ensure that valid references remain valid for the entire scope, recommend that weak references are evaluated only once.\n\nThe style in the example (using a guard to optionally bind `self`) is just the way I currently do this. It's kind of like using a `@strongify(self)` macro in Objective-C, combined with an early return;. Open to suggestions for alternative styles!","created_at":"2016-03-04T02:59:44Z","updated_at":"2016-03-04T02:59:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thoughtbot/guides/pulls/413/commits","review_comments_url":"https://api.github.com/repos/thoughtbot/guides/pulls/413/comments","review_comment_url":"https://api.github.com/repos/thoughtbot/guides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thoughtbot/guides/issues/413/comments","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/fdcfba7b6cd7bdd74aa430bb9acce6af28067349","head":{"label":"thoughtbot:as-strongify-weak-refs","ref":"as-strongify-weak-refs","sha":"fdcfba7b6cd7bdd74aa430bb9acce6af28067349","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":5200099,"name":"guides","full_name":"thoughtbot/guides","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/guides","description":"A guide for programming in style.","fork":false,"url":"https://api.github.com/repos/thoughtbot/guides","forks_url":"https://api.github.com/repos/thoughtbot/guides/forks","keys_url":"https://api.github.com/repos/thoughtbot/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/guides/teams","hooks_url":"https://api.github.com/repos/thoughtbot/guides/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/guides/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/guides/events","assignees_url":"https://api.github.com/repos/thoughtbot/guides/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/guides/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/guides/tags","blobs_url":"https://api.github.com/repos/thoughtbot/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/guides/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/guides/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/guides/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/guides/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/guides/subscription","commits_url":"https://api.github.com/repos/thoughtbot/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/guides/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/guides/merges","archive_url":"https://api.github.com/repos/thoughtbot/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/guides/downloads","issues_url":"https://api.github.com/repos/thoughtbot/guides/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/guides/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/guides/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/guides/deployments","created_at":"2012-07-27T03:15:44Z","updated_at":"2016-03-04T02:58:20Z","pushed_at":"2016-03-04T02:59:33Z","git_url":"git://github.com/thoughtbot/guides.git","ssh_url":"git@github.com:thoughtbot/guides.git","clone_url":"https://github.com/thoughtbot/guides.git","svn_url":"https://github.com/thoughtbot/guides","homepage":"https://robots.thoughtbot.com","size":1056,"stargazers_count":5137,"watchers_count":5137,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":784,"mirror_url":null,"open_issues_count":9,"forks":784,"open_issues":9,"watchers":5137,"default_branch":"master"}},"base":{"label":"thoughtbot:master","ref":"master","sha":"3de18a7da3aecf4f0f9892445a106dbde90000d2","user":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"repo":{"id":5200099,"name":"guides","full_name":"thoughtbot/guides","owner":{"login":"thoughtbot","id":6183,"avatar_url":"https://avatars.githubusercontent.com/u/6183?v=3","gravatar_id":"","url":"https://api.github.com/users/thoughtbot","html_url":"https://github.com/thoughtbot","followers_url":"https://api.github.com/users/thoughtbot/followers","following_url":"https://api.github.com/users/thoughtbot/following{/other_user}","gists_url":"https://api.github.com/users/thoughtbot/gists{/gist_id}","starred_url":"https://api.github.com/users/thoughtbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoughtbot/subscriptions","organizations_url":"https://api.github.com/users/thoughtbot/orgs","repos_url":"https://api.github.com/users/thoughtbot/repos","events_url":"https://api.github.com/users/thoughtbot/events{/privacy}","received_events_url":"https://api.github.com/users/thoughtbot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/thoughtbot/guides","description":"A guide for programming in style.","fork":false,"url":"https://api.github.com/repos/thoughtbot/guides","forks_url":"https://api.github.com/repos/thoughtbot/guides/forks","keys_url":"https://api.github.com/repos/thoughtbot/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thoughtbot/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thoughtbot/guides/teams","hooks_url":"https://api.github.com/repos/thoughtbot/guides/hooks","issue_events_url":"https://api.github.com/repos/thoughtbot/guides/issues/events{/number}","events_url":"https://api.github.com/repos/thoughtbot/guides/events","assignees_url":"https://api.github.com/repos/thoughtbot/guides/assignees{/user}","branches_url":"https://api.github.com/repos/thoughtbot/guides/branches{/branch}","tags_url":"https://api.github.com/repos/thoughtbot/guides/tags","blobs_url":"https://api.github.com/repos/thoughtbot/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thoughtbot/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thoughtbot/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/thoughtbot/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thoughtbot/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/thoughtbot/guides/languages","stargazers_url":"https://api.github.com/repos/thoughtbot/guides/stargazers","contributors_url":"https://api.github.com/repos/thoughtbot/guides/contributors","subscribers_url":"https://api.github.com/repos/thoughtbot/guides/subscribers","subscription_url":"https://api.github.com/repos/thoughtbot/guides/subscription","commits_url":"https://api.github.com/repos/thoughtbot/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/thoughtbot/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/thoughtbot/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/thoughtbot/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/thoughtbot/guides/contents/{+path}","compare_url":"https://api.github.com/repos/thoughtbot/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thoughtbot/guides/merges","archive_url":"https://api.github.com/repos/thoughtbot/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thoughtbot/guides/downloads","issues_url":"https://api.github.com/repos/thoughtbot/guides/issues{/number}","pulls_url":"https://api.github.com/repos/thoughtbot/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/thoughtbot/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/thoughtbot/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thoughtbot/guides/labels{/name}","releases_url":"https://api.github.com/repos/thoughtbot/guides/releases{/id}","deployments_url":"https://api.github.com/repos/thoughtbot/guides/deployments","created_at":"2012-07-27T03:15:44Z","updated_at":"2016-03-04T02:58:20Z","pushed_at":"2016-03-04T02:59:33Z","git_url":"git://github.com/thoughtbot/guides.git","ssh_url":"git@github.com:thoughtbot/guides.git","clone_url":"https://github.com/thoughtbot/guides.git","svn_url":"https://github.com/thoughtbot/guides","homepage":"https://robots.thoughtbot.com","size":1056,"stargazers_count":5137,"watchers_count":5137,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":784,"mirror_url":null,"open_issues_count":9,"forks":784,"open_issues":9,"watchers":5137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/413"},"html":{"href":"https://github.com/thoughtbot/guides/pull/413"},"issue":{"href":"https://api.github.com/repos/thoughtbot/guides/issues/413"},"comments":{"href":"https://api.github.com/repos/thoughtbot/guides/issues/413/comments"},"review_comments":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/413/comments"},"review_comment":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thoughtbot/guides/pulls/413/commits"},"statuses":{"href":"https://api.github.com/repos/thoughtbot/guides/statuses/fdcfba7b6cd7bdd74aa430bb9acce6af28067349"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":0,"changed_files":2}}