{"action":"created","comment":{"url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/comments/96460635","pull_request_review_id":17042994,"id":96460635,"diff_hunk":"@@ -253,6 +254,18 @@ Views should be layout using Apple's Auto Layout. No third-party frameworks are\n \n Old style layout is still an option for when Auto Layout is not available.\n \n+## Optional Force Unwrapping\n+\n+When something that shouldn't return an optional, returns an optional you have two options:\n+\n+**A)** Pass the error to the caller (throw): This is the ideal way of handling it, specially if there's the possibility of the app to recover. It's pretty straight forward, you create an `Error` or `NSError` with some information about the error, and throw it. [More information about throwing here.](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/ErrorHandling.html)\n+\n+For example, lets say you have a method that returns a filename for a photo, in theory all the photos should have a filename, so, the return value shouldn't be an optional. Throw an error in this case and let the method caller decide if they either go for crashing the app, or for just excluding the photo with the missing filename.","path":"BEST_PRACTICES.md","position":18,"original_position":18,"commit_id":"ce87d29310d71df225e9bfa22ed6977c117ce6c7","original_commit_id":"ce87d29310d71df225e9bfa22ed6977c117ce6c7","user":{"login":"Elland","id":54423,"avatar_url":"https://avatars.githubusercontent.com/u/54423?v=3","gravatar_id":"","url":"https://api.github.com/users/Elland","html_url":"https://github.com/Elland","followers_url":"https://api.github.com/users/Elland/followers","following_url":"https://api.github.com/users/Elland/following{/other_user}","gists_url":"https://api.github.com/users/Elland/gists{/gist_id}","starred_url":"https://api.github.com/users/Elland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elland/subscriptions","organizations_url":"https://api.github.com/users/Elland/orgs","repos_url":"https://api.github.com/users/Elland/repos","events_url":"https://api.github.com/users/Elland/events{/privacy}","received_events_url":"https://api.github.com/users/Elland/received_events","type":"User","site_admin":false},"body":"\"for example\" and \"lets say…\" both have the same function. We use one or the other. 👍 ","created_at":"2017-01-17T17:10:59Z","updated_at":"2017-01-17T17:10:59Z","html_url":"https://github.com/bakkenbaeck/iOS-playbook/pull/64#discussion_r96460635","pull_request_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/comments/96460635"},"html":{"href":"https://github.com/bakkenbaeck/iOS-playbook/pull/64#discussion_r96460635"},"pull_request":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64","id":89363471,"html_url":"https://github.com/bakkenbaeck/iOS-playbook/pull/64","diff_url":"https://github.com/bakkenbaeck/iOS-playbook/pull/64.diff","patch_url":"https://github.com/bakkenbaeck/iOS-playbook/pull/64.patch","issue_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/64","number":64,"state":"closed","locked":false,"title":"Add section about optional force unwrapping","user":{"login":"3lvis","id":1088217,"avatar_url":"https://avatars.githubusercontent.com/u/1088217?v=3","gravatar_id":"","url":"https://api.github.com/users/3lvis","html_url":"https://github.com/3lvis","followers_url":"https://api.github.com/users/3lvis/followers","following_url":"https://api.github.com/users/3lvis/following{/other_user}","gists_url":"https://api.github.com/users/3lvis/gists{/gist_id}","starred_url":"https://api.github.com/users/3lvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3lvis/subscriptions","organizations_url":"https://api.github.com/users/3lvis/orgs","repos_url":"https://api.github.com/users/3lvis/repos","events_url":"https://api.github.com/users/3lvis/events{/privacy}","received_events_url":"https://api.github.com/users/3lvis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-14T10:47:59Z","updated_at":"2017-01-17T17:10:59Z","closed_at":"2016-12-22T10:57:25Z","merged_at":"2016-12-22T10:57:25Z","merge_commit_sha":"39097d858f32c004d9fafe39562823980c97c4b4","assignee":{"login":"Elland","id":54423,"avatar_url":"https://avatars.githubusercontent.com/u/54423?v=3","gravatar_id":"","url":"https://api.github.com/users/Elland","html_url":"https://github.com/Elland","followers_url":"https://api.github.com/users/Elland/followers","following_url":"https://api.github.com/users/Elland/following{/other_user}","gists_url":"https://api.github.com/users/Elland/gists{/gist_id}","starred_url":"https://api.github.com/users/Elland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elland/subscriptions","organizations_url":"https://api.github.com/users/Elland/orgs","repos_url":"https://api.github.com/users/Elland/repos","events_url":"https://api.github.com/users/Elland/events{/privacy}","received_events_url":"https://api.github.com/users/Elland/received_events","type":"User","site_admin":false},"assignees":[{"login":"Elland","id":54423,"avatar_url":"https://avatars.githubusercontent.com/u/54423?v=3","gravatar_id":"","url":"https://api.github.com/users/Elland","html_url":"https://github.com/Elland","followers_url":"https://api.github.com/users/Elland/followers","following_url":"https://api.github.com/users/Elland/following{/other_user}","gists_url":"https://api.github.com/users/Elland/gists{/gist_id}","starred_url":"https://api.github.com/users/Elland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elland/subscriptions","organizations_url":"https://api.github.com/users/Elland/orgs","repos_url":"https://api.github.com/users/Elland/repos","events_url":"https://api.github.com/users/Elland/events{/privacy}","received_events_url":"https://api.github.com/users/Elland/received_events","type":"User","site_admin":false},{"login":"marijnschilling","id":1125417,"avatar_url":"https://avatars.githubusercontent.com/u/1125417?v=3","gravatar_id":"","url":"https://api.github.com/users/marijnschilling","html_url":"https://github.com/marijnschilling","followers_url":"https://api.github.com/users/marijnschilling/followers","following_url":"https://api.github.com/users/marijnschilling/following{/other_user}","gists_url":"https://api.github.com/users/marijnschilling/gists{/gist_id}","starred_url":"https://api.github.com/users/marijnschilling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marijnschilling/subscriptions","organizations_url":"https://api.github.com/users/marijnschilling/orgs","repos_url":"https://api.github.com/users/marijnschilling/repos","events_url":"https://api.github.com/users/marijnschilling/events{/privacy}","received_events_url":"https://api.github.com/users/marijnschilling/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64/commits","review_comments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64/comments","review_comment_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/64/comments","statuses_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/statuses/ce87d29310d71df225e9bfa22ed6977c117ce6c7","head":{"label":"bakkenbaeck:feature/add-section-about-optional-force-unwrapping","ref":"feature/add-section-about-optional-force-unwrapping","sha":"ce87d29310d71df225e9bfa22ed6977c117ce6c7","user":{"login":"bakkenbaeck","id":2485680,"avatar_url":"https://avatars.githubusercontent.com/u/2485680?v=3","gravatar_id":"","url":"https://api.github.com/users/bakkenbaeck","html_url":"https://github.com/bakkenbaeck","followers_url":"https://api.github.com/users/bakkenbaeck/followers","following_url":"https://api.github.com/users/bakkenbaeck/following{/other_user}","gists_url":"https://api.github.com/users/bakkenbaeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bakkenbaeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakkenbaeck/subscriptions","organizations_url":"https://api.github.com/users/bakkenbaeck/orgs","repos_url":"https://api.github.com/users/bakkenbaeck/repos","events_url":"https://api.github.com/users/bakkenbaeck/events{/privacy}","received_events_url":"https://api.github.com/users/bakkenbaeck/received_events","type":"Organization","site_admin":false},"repo":{"id":37313626,"name":"iOS-playbook","full_name":"bakkenbaeck/iOS-playbook","owner":{"login":"bakkenbaeck","id":2485680,"avatar_url":"https://avatars.githubusercontent.com/u/2485680?v=3","gravatar_id":"","url":"https://api.github.com/users/bakkenbaeck","html_url":"https://github.com/bakkenbaeck","followers_url":"https://api.github.com/users/bakkenbaeck/followers","following_url":"https://api.github.com/users/bakkenbaeck/following{/other_user}","gists_url":"https://api.github.com/users/bakkenbaeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bakkenbaeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakkenbaeck/subscriptions","organizations_url":"https://api.github.com/users/bakkenbaeck/orgs","repos_url":"https://api.github.com/users/bakkenbaeck/repos","events_url":"https://api.github.com/users/bakkenbaeck/events{/privacy}","received_events_url":"https://api.github.com/users/bakkenbaeck/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bakkenbaeck/iOS-playbook","description":"Guidelines and best practices for excellent iOS apps","fork":false,"url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook","forks_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/forks","keys_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/teams","hooks_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/hooks","issue_events_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/events{/number}","events_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/events","assignees_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/assignees{/user}","branches_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/branches{/branch}","tags_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/tags","blobs_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/statuses/{sha}","languages_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/languages","stargazers_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/stargazers","contributors_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/contributors","subscribers_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/subscribers","subscription_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/subscription","commits_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/contents/{+path}","compare_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/merges","archive_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/downloads","issues_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues{/number}","pulls_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls{/number}","milestones_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/milestones{/number}","notifications_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/labels{/name}","releases_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/releases{/id}","deployments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/deployments","created_at":"2015-06-12T09:28:07Z","updated_at":"2016-12-09T02:52:29Z","pushed_at":"2017-01-10T10:06:57Z","git_url":"git://github.com/bakkenbaeck/iOS-playbook.git","ssh_url":"git@github.com:bakkenbaeck/iOS-playbook.git","clone_url":"https://github.com/bakkenbaeck/iOS-playbook.git","svn_url":"https://github.com/bakkenbaeck/iOS-playbook","homepage":"","size":5450,"stargazers_count":20,"watchers_count":20,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":18,"forks":8,"open_issues":18,"watchers":20,"default_branch":"master"}},"base":{"label":"bakkenbaeck:master","ref":"master","sha":"c0bb4cb6c65672f99a6b0074d0b96a2bfb1b9592","user":{"login":"bakkenbaeck","id":2485680,"avatar_url":"https://avatars.githubusercontent.com/u/2485680?v=3","gravatar_id":"","url":"https://api.github.com/users/bakkenbaeck","html_url":"https://github.com/bakkenbaeck","followers_url":"https://api.github.com/users/bakkenbaeck/followers","following_url":"https://api.github.com/users/bakkenbaeck/following{/other_user}","gists_url":"https://api.github.com/users/bakkenbaeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bakkenbaeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakkenbaeck/subscriptions","organizations_url":"https://api.github.com/users/bakkenbaeck/orgs","repos_url":"https://api.github.com/users/bakkenbaeck/repos","events_url":"https://api.github.com/users/bakkenbaeck/events{/privacy}","received_events_url":"https://api.github.com/users/bakkenbaeck/received_events","type":"Organization","site_admin":false},"repo":{"id":37313626,"name":"iOS-playbook","full_name":"bakkenbaeck/iOS-playbook","owner":{"login":"bakkenbaeck","id":2485680,"avatar_url":"https://avatars.githubusercontent.com/u/2485680?v=3","gravatar_id":"","url":"https://api.github.com/users/bakkenbaeck","html_url":"https://github.com/bakkenbaeck","followers_url":"https://api.github.com/users/bakkenbaeck/followers","following_url":"https://api.github.com/users/bakkenbaeck/following{/other_user}","gists_url":"https://api.github.com/users/bakkenbaeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bakkenbaeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bakkenbaeck/subscriptions","organizations_url":"https://api.github.com/users/bakkenbaeck/orgs","repos_url":"https://api.github.com/users/bakkenbaeck/repos","events_url":"https://api.github.com/users/bakkenbaeck/events{/privacy}","received_events_url":"https://api.github.com/users/bakkenbaeck/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bakkenbaeck/iOS-playbook","description":"Guidelines and best practices for excellent iOS apps","fork":false,"url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook","forks_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/forks","keys_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/teams","hooks_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/hooks","issue_events_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/events{/number}","events_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/events","assignees_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/assignees{/user}","branches_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/branches{/branch}","tags_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/tags","blobs_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/statuses/{sha}","languages_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/languages","stargazers_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/stargazers","contributors_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/contributors","subscribers_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/subscribers","subscription_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/subscription","commits_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/contents/{+path}","compare_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/merges","archive_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/downloads","issues_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues{/number}","pulls_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls{/number}","milestones_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/milestones{/number}","notifications_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/labels{/name}","releases_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/releases{/id}","deployments_url":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/deployments","created_at":"2015-06-12T09:28:07Z","updated_at":"2016-12-09T02:52:29Z","pushed_at":"2017-01-10T10:06:57Z","git_url":"git://github.com/bakkenbaeck/iOS-playbook.git","ssh_url":"git@github.com:bakkenbaeck/iOS-playbook.git","clone_url":"https://github.com/bakkenbaeck/iOS-playbook.git","svn_url":"https://github.com/bakkenbaeck/iOS-playbook","homepage":"","size":5450,"stargazers_count":20,"watchers_count":20,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":18,"forks":8,"open_issues":18,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64"},"html":{"href":"https://github.com/bakkenbaeck/iOS-playbook/pull/64"},"issue":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/64"},"comments":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/bakkenbaeck/iOS-playbook/statuses/ce87d29310d71df225e9bfa22ed6977c117ce6c7"}}}}
{"actor":{"display_login":"Elland"}}