{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/190416964","pull_request_review_id":122788328,"id":190416964,"diff_hunk":"@@ -152,8 +160,42 @@ - (void)commonInit {\n     [_containerView.layer addSublayer:_borderLayer];\n     \n     _formatter = [[MGLDistanceFormatter alloc] init];\n+\n+    // Image labels are now images\n+    _labelImageCache              = [[NSCache alloc] init];\n+    _prototypeLabel               = [[MGLScaleBarLabel alloc] init];\n+    _prototypeLabel.font          = [UIFont systemFontOfSize:8 weight:UIFontWeightMedium];\n+    _prototypeLabel.clipsToBounds = NO;\n+\n+    NSUInteger numberOfLabels = 4;\n+    NSMutableArray *labelViews = [NSMutableArray arrayWithCapacity:numberOfLabels];\n+\n+    for (NSUInteger i = 0; i < numberOfLabels; i++) {\n+        UIView *view = [[UIView alloc] init];\n+        view.bounds        = CGRectZero;\n+        view.clipsToBounds = NO;\n+        view.contentMode   = UIViewContentModeCenter;\n+        view.hidden        = YES;\n+        [labelViews addObject:view];\n+        [self addSubview:view];\n+    }\n+    _labelViews = [labelViews copy];\n+\n+    // Zero is a special case (no formatting)\n+    [self addZeroLabel];\n+\n+    [[NSNotificationCenter defaultCenter] addObserver:self\n+                                             selector:@selector(currentLocaleDidChange:)\n+                                                 name:NSCurrentLocaleDidChangeNotification\n+                                               object:nil];\n }\n \n+- (void)currentLocaleDidChange:(NSNotification*)notification {\n+    // Clear the cache, so labels should be rebuilt.\n+    [self.labelImageCache removeAllObjects];","path":"platform/ios/src/MGLScaleBar.mm","position":67,"original_position":67,"commit_id":"92606a8341f0697234497967abd585aa051ffdd5","original_commit_id":"92606a8341f0697234497967abd585aa051ffdd5","user":{"login":"fabian-guerra","id":2745166,"avatar_url":"https://avatars2.githubusercontent.com/u/2745166?v=4","gravatar_id":"","url":"https://api.github.com/users/fabian-guerra","html_url":"https://github.com/fabian-guerra","followers_url":"https://api.github.com/users/fabian-guerra/followers","following_url":"https://api.github.com/users/fabian-guerra/following{/other_user}","gists_url":"https://api.github.com/users/fabian-guerra/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-guerra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-guerra/subscriptions","organizations_url":"https://api.github.com/users/fabian-guerra/orgs","repos_url":"https://api.github.com/users/fabian-guerra/repos","events_url":"https://api.github.com/users/fabian-guerra/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-guerra/received_events","type":"User","site_admin":false},"body":"Right and it may not free anything if it receives a memory warning. If you consider is not necessary then I'm OK.","created_at":"2018-05-23T22:20:00Z","updated_at":"2018-05-23T22:20:00Z","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/11921#discussion_r190416964","pull_request_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/190416964"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/11921#discussion_r190416964"},"pull_request":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921"}},"in_reply_to_id":190386243},"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921","id":188413785,"html_url":"https://github.com/mapbox/mapbox-gl-native/pull/11921","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/11921.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/11921.patch","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/11921","number":11921,"state":"open","locked":false,"title":"Updated MGLScaleBar to use rendered UIImages instead of MGLScaleBarLabel","user":{"login":"julianrex","id":3765757,"avatar_url":"https://avatars0.githubusercontent.com/u/3765757?v=4","gravatar_id":"","url":"https://api.github.com/users/julianrex","html_url":"https://github.com/julianrex","followers_url":"https://api.github.com/users/julianrex/followers","following_url":"https://api.github.com/users/julianrex/following{/other_user}","gists_url":"https://api.github.com/users/julianrex/gists{/gist_id}","starred_url":"https://api.github.com/users/julianrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianrex/subscriptions","organizations_url":"https://api.github.com/users/julianrex/orgs","repos_url":"https://api.github.com/users/julianrex/repos","events_url":"https://api.github.com/users/julianrex/events{/privacy}","received_events_url":"https://api.github.com/users/julianrex/received_events","type":"User","site_admin":false},"body":"- Added a new \"random world tour\" to iOS for testing/profiling purposes\r\n- Render MGLScaleBarLabel on demand caching the resulting UIImages for use as scale bar labels\r\n\r\nEdit: No changelog entry yet","created_at":"2018-05-16T12:21:25Z","updated_at":"2018-05-23T22:20:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d805e9343ea5ae880f61977c66d9d01791c8fe57","assignee":{"login":"julianrex","id":3765757,"avatar_url":"https://avatars0.githubusercontent.com/u/3765757?v=4","gravatar_id":"","url":"https://api.github.com/users/julianrex","html_url":"https://github.com/julianrex","followers_url":"https://api.github.com/users/julianrex/followers","following_url":"https://api.github.com/users/julianrex/following{/other_user}","gists_url":"https://api.github.com/users/julianrex/gists{/gist_id}","starred_url":"https://api.github.com/users/julianrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianrex/subscriptions","organizations_url":"https://api.github.com/users/julianrex/orgs","repos_url":"https://api.github.com/users/julianrex/repos","events_url":"https://api.github.com/users/julianrex/events{/privacy}","received_events_url":"https://api.github.com/users/julianrex/received_events","type":"User","site_admin":false},"assignees":[{"login":"julianrex","id":3765757,"avatar_url":"https://avatars0.githubusercontent.com/u/3765757?v=4","gravatar_id":"","url":"https://api.github.com/users/julianrex","html_url":"https://github.com/julianrex","followers_url":"https://api.github.com/users/julianrex/followers","following_url":"https://api.github.com/users/julianrex/following{/other_user}","gists_url":"https://api.github.com/users/julianrex/gists{/gist_id}","starred_url":"https://api.github.com/users/julianrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianrex/subscriptions","organizations_url":"https://api.github.com/users/julianrex/orgs","repos_url":"https://api.github.com/users/julianrex/repos","events_url":"https://api.github.com/users/julianrex/events{/privacy}","received_events_url":"https://api.github.com/users/julianrex/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"frederoni","id":764476,"avatar_url":"https://avatars1.githubusercontent.com/u/764476?v=4","gravatar_id":"","url":"https://api.github.com/users/frederoni","html_url":"https://github.com/frederoni","followers_url":"https://api.github.com/users/frederoni/followers","following_url":"https://api.github.com/users/frederoni/following{/other_user}","gists_url":"https://api.github.com/users/frederoni/gists{/gist_id}","starred_url":"https://api.github.com/users/frederoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frederoni/subscriptions","organizations_url":"https://api.github.com/users/frederoni/orgs","repos_url":"https://api.github.com/users/frederoni/repos","events_url":"https://api.github.com/users/frederoni/events{/privacy}","received_events_url":"https://api.github.com/users/frederoni/received_events","type":"User","site_admin":false},{"login":"1ec5","id":1231218,"avatar_url":"https://avatars0.githubusercontent.com/u/1231218?v=4","gravatar_id":"","url":"https://api.github.com/users/1ec5","html_url":"https://github.com/1ec5","followers_url":"https://api.github.com/users/1ec5/followers","following_url":"https://api.github.com/users/1ec5/following{/other_user}","gists_url":"https://api.github.com/users/1ec5/gists{/gist_id}","starred_url":"https://api.github.com/users/1ec5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1ec5/subscriptions","organizations_url":"https://api.github.com/users/1ec5/orgs","repos_url":"https://api.github.com/users/1ec5/repos","events_url":"https://api.github.com/users/1ec5/events{/privacy}","received_events_url":"https://api.github.com/users/1ec5/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":92400707,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"000000","default":false},{"id":101435202,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/performance","name":"performance","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921/commits","review_comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921/comments","review_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/11921/comments","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/92606a8341f0697234497967abd585aa051ffdd5","head":{"label":"mapbox:jrex-scalebar","ref":"jrex-scalebar","sha":"92606a8341f0697234497967abd585aa051ffdd5","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2018-05-23T19:22:24Z","pushed_at":"2018-05-23T20:33:57Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":205663,"stargazers_count":2616,"watchers_count":2616,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":815,"mirror_url":null,"archived":false,"open_issues_count":711,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":815,"open_issues":711,"watchers":2616,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"1aa5c67837a19d5f8ba8f7336f183da83e68441c","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars1.githubusercontent.com/u/600935?v=4","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2018-05-23T19:22:24Z","pushed_at":"2018-05-23T20:33:57Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":205663,"stargazers_count":2616,"watchers_count":2616,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":815,"mirror_url":null,"archived":false,"open_issues_count":711,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":815,"open_issues":711,"watchers":2616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/11921"},"issue":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/11921"},"comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/11921/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/11921/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/92606a8341f0697234497967abd585aa051ffdd5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fabian-guerra"}}