{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/89012773","pull_request_review_id":9566354,"id":89012773,"diff_hunk":"@@ -0,0 +1,148 @@\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 \"SwatchColor.h\"\n+\n+@implementation SwatchColor\n+\n++ (NSDictionary *)sharedColors\n+{\n+    static NSDictionary<NSString *, UIColor*> *swatchColors;\n+    static dispatch_once_t onceToken;\n+    dispatch_once(&onceToken, ^{","path":"examples/ios/objc/Draw/Models/SwatchColor.m","position":27,"original_position":27,"commit_id":"076989a5150b22479c2c24592603996923f5a0d0","original_commit_id":"076989a5150b22479c2c24592603996923f5a0d0","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":"Wouldn't it be simpler to store the colors in a static `NSDictionary`, get rid of the `SwatchColor` class, and just get colors by subscripting from the dictionary? Seems like it'd cut down on a lot of code and would make things simpler and faster by reducing runtime allocations.","created_at":"2016-11-21T23:25:29Z","updated_at":"2016-11-21T23:25:32Z","html_url":"https://github.com/realm/realm-cocoa/pull/4269#discussion_r89012773","pull_request_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/89012773"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/4269#discussion_r89012773"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269","id":91296709,"html_url":"https://github.com/realm/realm-cocoa/pull/4269","diff_url":"https://github.com/realm/realm-cocoa/pull/4269.diff","patch_url":"https://github.com/realm/realm-cocoa/pull/4269.patch","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/4269","number":4269,"state":"open","locked":false,"title":"Realm Draw Demo App","user":{"login":"TimOliver","id":429119,"avatar_url":"https://avatars.githubusercontent.com/u/429119?v=3","gravatar_id":"","url":"https://api.github.com/users/TimOliver","html_url":"https://github.com/TimOliver","followers_url":"https://api.github.com/users/TimOliver/followers","following_url":"https://api.github.com/users/TimOliver/following{/other_user}","gists_url":"https://api.github.com/users/TimOliver/gists{/gist_id}","starred_url":"https://api.github.com/users/TimOliver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimOliver/subscriptions","organizations_url":"https://api.github.com/users/TimOliver/orgs","repos_url":"https://api.github.com/users/TimOliver/repos","events_url":"https://api.github.com/users/TimOliver/events{/privacy}","received_events_url":"https://api.github.com/users/TimOliver/received_events","type":"User","site_admin":false},"body":"This PR adds the Realm Draw demo app (As seen in the [Realm Mobile Platform launch video](https://realm.io/news/introducing-realm-mobile-platform/) ) to the public Realm Cocoa repo.\n\n![img_0250](https://cloud.githubusercontent.com/assets/429119/19788757/1942327a-9c5f-11e6-8408-7db1b03019e2.PNG)\n","created_at":"2016-10-27T23:05:08Z","updated_at":"2016-11-21T23:25:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9eef171db32cc55b7f25df335db8716520411d7","assignee":{"login":"TimOliver","id":429119,"avatar_url":"https://avatars.githubusercontent.com/u/429119?v=3","gravatar_id":"","url":"https://api.github.com/users/TimOliver","html_url":"https://github.com/TimOliver","followers_url":"https://api.github.com/users/TimOliver/followers","following_url":"https://api.github.com/users/TimOliver/following{/other_user}","gists_url":"https://api.github.com/users/TimOliver/gists{/gist_id}","starred_url":"https://api.github.com/users/TimOliver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimOliver/subscriptions","organizations_url":"https://api.github.com/users/TimOliver/orgs","repos_url":"https://api.github.com/users/TimOliver/repos","events_url":"https://api.github.com/users/TimOliver/events{/privacy}","received_events_url":"https://api.github.com/users/TimOliver/received_events","type":"User","site_admin":false},"assignees":[{"login":"TimOliver","id":429119,"avatar_url":"https://avatars.githubusercontent.com/u/429119?v=3","gravatar_id":"","url":"https://api.github.com/users/TimOliver","html_url":"https://github.com/TimOliver","followers_url":"https://api.github.com/users/TimOliver/followers","following_url":"https://api.github.com/users/TimOliver/following{/other_user}","gists_url":"https://api.github.com/users/TimOliver/gists{/gist_id}","starred_url":"https://api.github.com/users/TimOliver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimOliver/subscriptions","organizations_url":"https://api.github.com/users/TimOliver/orgs","repos_url":"https://api.github.com/users/TimOliver/repos","events_url":"https://api.github.com/users/TimOliver/events{/privacy}","received_events_url":"https://api.github.com/users/TimOliver/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269/commits","review_comments_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269/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/4269/comments","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/076989a5150b22479c2c24592603996923f5a0d0","head":{"label":"realm:to-sync-draw-app","ref":"to-sync-draw-app","sha":"076989a5150b22479c2c24592603996923f5a0d0","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}","deployments_url":"https://api.github.com/repos/realm/realm-cocoa/deployments","created_at":"2012-04-16T20:06:56Z","updated_at":"2016-11-21T16:34:30Z","pushed_at":"2016-11-21T13:26:48Z","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":130032,"stargazers_count":9326,"watchers_count":9326,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1152,"mirror_url":null,"open_issues_count":245,"forks":1152,"open_issues":245,"watchers":9326,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"1eb77506c2dfd563364a990bed20a2e81e112483","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}","deployments_url":"https://api.github.com/repos/realm/realm-cocoa/deployments","created_at":"2012-04-16T20:06:56Z","updated_at":"2016-11-21T16:34:30Z","pushed_at":"2016-11-21T13:26:48Z","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":130032,"stargazers_count":9326,"watchers_count":9326,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1152,"mirror_url":null,"open_issues_count":245,"forks":1152,"open_issues":245,"watchers":9326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/4269"},"issue":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/4269"},"comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/4269/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/4269/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/4269/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-cocoa/statuses/076989a5150b22479c2c24592603996923f5a0d0"}}}}
{"actor":{"display_login":"jpsim"}}