{"action":"created","comment":{"url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/comments/243889012","pull_request_review_id":187767446,"id":243889012,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzg4OTAxMg==","diff_hunk":"@@ -0,0 +1,37 @@\n+//\n+//  ImageDownloader.swift\n+//  GitHubApp\n+//\n+//  Created by 岩永 彩里 on 2018/12/11.\n+//  Copyright © 2018年 岩永 彩里. All rights reserved.\n+//\n+\n+import UIKit\n+\n+final class ImageDownloader: NSCache<AnyObject, AnyObject> {\n+    static let shared = ImageDownloader()\n+\n+    func fetchImage(imageUrlString: String, completion: @escaping ((UIImage?, Error?) -> Void)) -> URLSessionTask? {\n+        //キャッシュとして保存されている場合\n+        if let imageFromCache = ImageDownloader.shared.object(forKey: imageUrlString as AnyObject) as? UIImage {\n+            DispatchQueue.main.async { completion(imageFromCache, nil) }\n+            return nil\n+        //キャッシュとして保存されていなかった場合\n+        } else {\n+            let userImageURL: URL = URL(string: \"\\(imageUrlString)\")!\n+            let task = URLSession.shared.dataTask(with: userImageURL, completionHandler: {data, _, error in","path":"GitHubApp/ImageDownloader.swift","position":22,"original_position":22,"commit_id":"6fc230a21bbab4f9657b7b4192d4f66dcd4a5309","original_commit_id":"6fc230a21bbab4f9657b7b4192d4f66dcd4a5309","user":{"login":"konomae","id":1920783,"node_id":"MDQ6VXNlcjE5MjA3ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/1920783?v=4","gravatar_id":"","url":"https://api.github.com/users/konomae","html_url":"https://github.com/konomae","followers_url":"https://api.github.com/users/konomae/followers","following_url":"https://api.github.com/users/konomae/following{/other_user}","gists_url":"https://api.github.com/users/konomae/gists{/gist_id}","starred_url":"https://api.github.com/users/konomae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konomae/subscriptions","organizations_url":"https://api.github.com/users/konomae/orgs","repos_url":"https://api.github.com/users/konomae/repos","events_url":"https://api.github.com/users/konomae/events{/privacy}","received_events_url":"https://api.github.com/users/konomae/received_events","type":"User","site_admin":false},"body":"`completionHandler: {data` => `completionHandler: { data`\r\n\r\nswiftlint を入れた旨味が出てない気がしますね・・・。\r\n設定を見直してみて、自動で検出、自動訂正できるようにすると便利だと思います。","created_at":"2018-12-25T08:33:19Z","updated_at":"2018-12-25T08:35:25Z","html_url":"https://github.com/IwanagaSari/GitHubApp1/pull/12#discussion_r243889012","pull_request_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/comments/243889012"},"html":{"href":"https://github.com/IwanagaSari/GitHubApp1/pull/12#discussion_r243889012"},"pull_request":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12","id":237669186,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3NjY5MTg2","html_url":"https://github.com/IwanagaSari/GitHubApp1/pull/12","diff_url":"https://github.com/IwanagaSari/GitHubApp1/pull/12.diff","patch_url":"https://github.com/IwanagaSari/GitHubApp1/pull/12.patch","issue_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/12","number":12,"state":"open","locked":false,"title":"NSCacheを利用して画像データを保存する。","user":{"login":"IwanagaSari","id":39400528,"node_id":"MDQ6VXNlcjM5NDAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/39400528?v=4","gravatar_id":"","url":"https://api.github.com/users/IwanagaSari","html_url":"https://github.com/IwanagaSari","followers_url":"https://api.github.com/users/IwanagaSari/followers","following_url":"https://api.github.com/users/IwanagaSari/following{/other_user}","gists_url":"https://api.github.com/users/IwanagaSari/gists{/gist_id}","starred_url":"https://api.github.com/users/IwanagaSari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IwanagaSari/subscriptions","organizations_url":"https://api.github.com/users/IwanagaSari/orgs","repos_url":"https://api.github.com/users/IwanagaSari/repos","events_url":"https://api.github.com/users/IwanagaSari/events{/privacy}","received_events_url":"https://api.github.com/users/IwanagaSari/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-11T12:56:36Z","updated_at":"2018-12-25T08:35:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a005683560f75ec832fce80ddb8c5e6f4528b88e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12/commits","review_comments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12/comments","review_comment_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/12/comments","statuses_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/statuses/6fc230a21bbab4f9657b7b4192d4f66dcd4a5309","head":{"label":"IwanagaSari:image-NSCache","ref":"image-NSCache","sha":"6fc230a21bbab4f9657b7b4192d4f66dcd4a5309","user":{"login":"IwanagaSari","id":39400528,"node_id":"MDQ6VXNlcjM5NDAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/39400528?v=4","gravatar_id":"","url":"https://api.github.com/users/IwanagaSari","html_url":"https://github.com/IwanagaSari","followers_url":"https://api.github.com/users/IwanagaSari/followers","following_url":"https://api.github.com/users/IwanagaSari/following{/other_user}","gists_url":"https://api.github.com/users/IwanagaSari/gists{/gist_id}","starred_url":"https://api.github.com/users/IwanagaSari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IwanagaSari/subscriptions","organizations_url":"https://api.github.com/users/IwanagaSari/orgs","repos_url":"https://api.github.com/users/IwanagaSari/repos","events_url":"https://api.github.com/users/IwanagaSari/events{/privacy}","received_events_url":"https://api.github.com/users/IwanagaSari/received_events","type":"User","site_admin":false},"repo":{"id":150253042,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAyNTMwNDI=","name":"GitHubApp1","full_name":"IwanagaSari/GitHubApp1","private":false,"owner":{"login":"IwanagaSari","id":39400528,"node_id":"MDQ6VXNlcjM5NDAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/39400528?v=4","gravatar_id":"","url":"https://api.github.com/users/IwanagaSari","html_url":"https://github.com/IwanagaSari","followers_url":"https://api.github.com/users/IwanagaSari/followers","following_url":"https://api.github.com/users/IwanagaSari/following{/other_user}","gists_url":"https://api.github.com/users/IwanagaSari/gists{/gist_id}","starred_url":"https://api.github.com/users/IwanagaSari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IwanagaSari/subscriptions","organizations_url":"https://api.github.com/users/IwanagaSari/orgs","repos_url":"https://api.github.com/users/IwanagaSari/repos","events_url":"https://api.github.com/users/IwanagaSari/events{/privacy}","received_events_url":"https://api.github.com/users/IwanagaSari/received_events","type":"User","site_admin":false},"html_url":"https://github.com/IwanagaSari/GitHubApp1","description":"各画面の作成","fork":false,"url":"https://api.github.com/repos/IwanagaSari/GitHubApp1","forks_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/forks","keys_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/teams","hooks_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/hooks","issue_events_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/events{/number}","events_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/events","assignees_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/assignees{/user}","branches_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/branches{/branch}","tags_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/tags","blobs_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/refs{/sha}","trees_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/statuses/{sha}","languages_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/languages","stargazers_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/stargazers","contributors_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/contributors","subscribers_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/subscribers","subscription_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/subscription","commits_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/commits{/sha}","git_commits_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/commits{/sha}","comments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/comments{/number}","issue_comment_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/comments{/number}","contents_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/contents/{+path}","compare_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/merges","archive_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/downloads","issues_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues{/number}","pulls_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls{/number}","milestones_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/milestones{/number}","notifications_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/labels{/name}","releases_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/releases{/id}","deployments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/deployments","created_at":"2018-09-25T11:16:24Z","updated_at":"2018-12-04T10:08:37Z","pushed_at":"2018-12-18T10:51:47Z","git_url":"git://github.com/IwanagaSari/GitHubApp1.git","ssh_url":"git@github.com:IwanagaSari/GitHubApp1.git","clone_url":"https://github.com/IwanagaSari/GitHubApp1.git","svn_url":"https://github.com/IwanagaSari/GitHubApp1","homepage":null,"size":182,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"IwanagaSari:master","ref":"master","sha":"a76136266b183b829a4fb0bdb91ae2258277d143","user":{"login":"IwanagaSari","id":39400528,"node_id":"MDQ6VXNlcjM5NDAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/39400528?v=4","gravatar_id":"","url":"https://api.github.com/users/IwanagaSari","html_url":"https://github.com/IwanagaSari","followers_url":"https://api.github.com/users/IwanagaSari/followers","following_url":"https://api.github.com/users/IwanagaSari/following{/other_user}","gists_url":"https://api.github.com/users/IwanagaSari/gists{/gist_id}","starred_url":"https://api.github.com/users/IwanagaSari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IwanagaSari/subscriptions","organizations_url":"https://api.github.com/users/IwanagaSari/orgs","repos_url":"https://api.github.com/users/IwanagaSari/repos","events_url":"https://api.github.com/users/IwanagaSari/events{/privacy}","received_events_url":"https://api.github.com/users/IwanagaSari/received_events","type":"User","site_admin":false},"repo":{"id":150253042,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAyNTMwNDI=","name":"GitHubApp1","full_name":"IwanagaSari/GitHubApp1","private":false,"owner":{"login":"IwanagaSari","id":39400528,"node_id":"MDQ6VXNlcjM5NDAwNTI4","avatar_url":"https://avatars2.githubusercontent.com/u/39400528?v=4","gravatar_id":"","url":"https://api.github.com/users/IwanagaSari","html_url":"https://github.com/IwanagaSari","followers_url":"https://api.github.com/users/IwanagaSari/followers","following_url":"https://api.github.com/users/IwanagaSari/following{/other_user}","gists_url":"https://api.github.com/users/IwanagaSari/gists{/gist_id}","starred_url":"https://api.github.com/users/IwanagaSari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IwanagaSari/subscriptions","organizations_url":"https://api.github.com/users/IwanagaSari/orgs","repos_url":"https://api.github.com/users/IwanagaSari/repos","events_url":"https://api.github.com/users/IwanagaSari/events{/privacy}","received_events_url":"https://api.github.com/users/IwanagaSari/received_events","type":"User","site_admin":false},"html_url":"https://github.com/IwanagaSari/GitHubApp1","description":"各画面の作成","fork":false,"url":"https://api.github.com/repos/IwanagaSari/GitHubApp1","forks_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/forks","keys_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/teams","hooks_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/hooks","issue_events_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/events{/number}","events_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/events","assignees_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/assignees{/user}","branches_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/branches{/branch}","tags_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/tags","blobs_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/refs{/sha}","trees_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/statuses/{sha}","languages_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/languages","stargazers_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/stargazers","contributors_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/contributors","subscribers_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/subscribers","subscription_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/subscription","commits_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/commits{/sha}","git_commits_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/git/commits{/sha}","comments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/comments{/number}","issue_comment_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/comments{/number}","contents_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/contents/{+path}","compare_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/merges","archive_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/downloads","issues_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues{/number}","pulls_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls{/number}","milestones_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/milestones{/number}","notifications_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/labels{/name}","releases_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/releases{/id}","deployments_url":"https://api.github.com/repos/IwanagaSari/GitHubApp1/deployments","created_at":"2018-09-25T11:16:24Z","updated_at":"2018-12-04T10:08:37Z","pushed_at":"2018-12-18T10:51:47Z","git_url":"git://github.com/IwanagaSari/GitHubApp1.git","ssh_url":"git@github.com:IwanagaSari/GitHubApp1.git","clone_url":"https://github.com/IwanagaSari/GitHubApp1.git","svn_url":"https://github.com/IwanagaSari/GitHubApp1","homepage":null,"size":182,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12"},"html":{"href":"https://github.com/IwanagaSari/GitHubApp1/pull/12"},"issue":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/12"},"comments":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/IwanagaSari/GitHubApp1/statuses/6fc230a21bbab4f9657b7b4192d4f66dcd4a5309"}},"author_association":"OWNER"}}
{"actor":{"display_login":"konomae"}}