{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/comments/111220200","pull_request_review_id":32450839,"id":111220200,"diff_hunk":"@@ -119,138 +127,114 @@ - (void)reverseGeocodeLocation:(CLLocation*)location completionHandler:(CLGeocod\n         } else {\n             self.geocoding = true;\n \n-            WDGBasicGeoposition* geoposition = [[WDGBasicGeoposition alloc] init];\n-            geoposition.latitude = location.coordinate.latitude;\n-            geoposition.longitude = location.coordinate.longitude;\n+            BasicGeoposition geoposition;\n+            geoposition.Latitude = location.coordinate.latitude;\n+            geoposition.Longitude = location.coordinate.longitude;\n \n-            WDGGeopoint* geopoint = [WDGGeopoint make:geoposition];\n+            Geopoint geopoint(geoposition);\n \n-            [WSMMapLocationFinder findLocationsAtAsync:geopoint\n-                success:^void(WSMMapLocationFinderResult* results) {\n-                    self.geocoding = false;\n+            WF::IAsyncOperation<MapLocationFinderResult> async = MapLocationFinder::FindLocationsAtAsync(geopoint);\n \n-                    WSMMapLocationFinderStatus status = results.status;\n-                    NSError* geocodeStatus = parseError(results);\n+            async.Completed(objcwinrt::callback([self, completionHandler] (const WF::IAsyncOperation<MapLocationFinderResult>& op, WF::AsyncStatus status) {\n+                NSError* geocodeStatus = objcwinrt::to_nserror(op, status);\n+                NSMutableArray* geocodeResult = nil;\n+                self.geocoding = NO;\n \n-                    NSMutableArray* geocodeResult = [[NSMutableArray alloc] init];\n-                    createResultsArray(results, geocodeResult);\n+                if (status == WF::AsyncStatus::Completed) {\n+                    MapLocationFinderResult result = op.GetResults();\n+                    geocodeStatus = parseError(result);\n \n-                    dispatch_async(dispatch_get_main_queue(), ^{\n-                        completionHandler(geocodeResult, geocodeStatus);\n-                    });\n+                    geocodeResult = [[NSMutableArray alloc] init];\n+                    createResultsArray(result, geocodeResult);\n                 }\n-                failure:^void(NSError* error) {\n-                    self.geocoding = false;\n-                    dispatch_async(dispatch_get_main_queue(), ^{\n-                        completionHandler(nullptr, error);\n-                    });\n-                }];\n+\n+                dispatch_async(dispatch_get_main_queue(), ^{\n+                    completionHandler(geocodeResult, geocodeStatus);\n+                });\n+            }));\n         }\n     }\n }\n \n /**\n- @Status Interoperable\n+ Internal method\n */\n-- (void)geocodeAddressDictionary:(NSDictionary*)addressDictionary completionHandler:(CLGeocodeCompletionHandler)completionHandler {\n+- (void)_geocodeAddress:(NSString*)address atPoint:(const Geopoint&)point completionHandler:(CLGeocodeCompletionHandler)completion {\n     @synchronized(self) {\n         if (self.isGeocoding) {\n             dispatch_async(dispatch_get_main_queue(), ^{\n-                completionHandler(nullptr, [NSError errorWithDomain:@\"kCLErrorDomain\" code:kCLErrorGeocodeCanceled userInfo:nullptr]);\n+                completion(nil, [NSError errorWithDomain:@\"kCLErrorDomain\" code:kCLErrorGeocodeCanceled userInfo:nil]);\n             });\n         } else {\n-            self.geocoding = true;\n+            self.geocoding = YES;\n+\n+            WF::IAsyncOperation<MapLocationFinderResult> async =\n+                MapLocationFinder::FindLocationsAsync(objcwinrt::string(address), point);\n+\n+            async.Completed(objcwinrt::callback([self, completion] (const WF::IAsyncOperation<MapLocationFinderResult>& op, WF::AsyncStatus status) {\n+                NSError* geocodeStatus = objcwinrt::to_nserror(op, status);\n+                NSMutableArray* geocodeResult = nil;\n+                self.geocoding = NO;\n \n-            const NSString* addressStreet = (const NSString*)[addressDictionary objectForKey:@\"Street\"];\n-            const NSString* addressCity = (const NSString*)[addressDictionary objectForKey:@\"City\"];\n-            const NSString* addressState = (const NSString*)[addressDictionary objectForKey:@\"State\"];\n-            const NSString* addressZIP = (const NSString*)[addressDictionary objectForKey:@\"ZIP\"];\n-            const NSString* addressCountry = (const NSString*)[addressDictionary objectForKey:@\"Country\"];\n-\n-            NSMutableString* fullAddress = [[NSMutableString alloc] init];\n-            if (addressStreet) {\n-                [fullAddress appendFormat:@\"%@, \", addressStreet];\n-            }\n-\n-            if (addressCity) {\n-                [fullAddress appendFormat:@\"%@, \", addressCity];\n-            }\n-\n-            if (addressState && addressZIP) {\n-                [fullAddress appendFormat:@\"%@ %@, \", addressState, addressZIP];\n-            } else if (addressState) {\n-                [fullAddress appendFormat:@\"%@, \", addressState];\n-            } else if (addressZIP) {\n-                [fullAddress appendFormat:@\"%@, \", addressZIP];\n-            }\n-\n-            if (addressCountry) {\n-                [fullAddress appendFormat:@\"%@\", addressCountry];\n-            }\n-\n-            if ([fullAddress hasSuffix:@\", \"]) {\n-                [fullAddress deleteCharactersInRange:NSMakeRange([fullAddress length] - 2, 2)];\n-            }\n-\n-            [WSMMapLocationFinder findLocationsAsync:fullAddress\n-                referencePoint:nullptr\n-                success:^void(WSMMapLocationFinderResult* results) {\n-                    self.geocoding = false;\n-\n-                    WSMMapLocationFinderStatus status = results.status;\n-                    NSError* geocodeStatus = parseError(results);\n-\n-                    NSMutableArray* geocodeResult = [[NSMutableArray alloc] init];\n-                    createResultsArray(results, geocodeResult);\n-\n-                    dispatch_async(dispatch_get_main_queue(), ^{\n-                        completionHandler(geocodeResult, geocodeStatus);\n-                    });\n+                if (status == WF::AsyncStatus::Completed) {\n+                    MapLocationFinderResult result = op.GetResults();\n+                    geocodeStatus = parseError(result);\n+\n+                    geocodeResult = [[NSMutableArray alloc] init];","path":"Frameworks/CoreLocation/CLGeocoder.mm","position":243,"original_position":243,"commit_id":"22afc219c803f796859b0aba6162f0d63f151c06","original_commit_id":"22afc219c803f796859b0aba6162f0d63f151c06","user":{"login":"msft-Jeyaram","id":18413092,"avatar_url":"https://avatars3.githubusercontent.com/u/18413092?v=3","gravatar_id":"","url":"https://api.github.com/users/msft-Jeyaram","html_url":"https://github.com/msft-Jeyaram","followers_url":"https://api.github.com/users/msft-Jeyaram/followers","following_url":"https://api.github.com/users/msft-Jeyaram/following{/other_user}","gists_url":"https://api.github.com/users/msft-Jeyaram/gists{/gist_id}","starred_url":"https://api.github.com/users/msft-Jeyaram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msft-Jeyaram/subscriptions","organizations_url":"https://api.github.com/users/msft-Jeyaram/orgs","repos_url":"https://api.github.com/users/msft-Jeyaram/repos","events_url":"https://api.github.com/users/msft-Jeyaram/events{/privacy}","received_events_url":"https://api.github.com/users/msft-Jeyaram/received_events","type":"User","site_admin":false},"body":">[NSMutableArray alloc] init]; [](start = 37, length = 29)\r\n\r\nsame here?","created_at":"2017-04-12T18:03:42Z","updated_at":"2017-04-12T18:03:42Z","html_url":"https://github.com/Microsoft/WinObjC/pull/2497#discussion_r111220200","pull_request_url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/comments/111220200"},"html":{"href":"https://github.com/Microsoft/WinObjC/pull/2497#discussion_r111220200"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497","id":115430674,"html_url":"https://github.com/Microsoft/WinObjC/pull/2497","diff_url":"https://github.com/Microsoft/WinObjC/pull/2497.diff","patch_url":"https://github.com/Microsoft/WinObjC/pull/2497.patch","issue_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/2497","number":2497,"state":"open","locked":false,"title":"Convert CoreLocation to C++/WinRT","user":{"login":"bviglietta","id":7670607,"avatar_url":"https://avatars3.githubusercontent.com/u/7670607?v=3","gravatar_id":"","url":"https://api.github.com/users/bviglietta","html_url":"https://github.com/bviglietta","followers_url":"https://api.github.com/users/bviglietta/followers","following_url":"https://api.github.com/users/bviglietta/following{/other_user}","gists_url":"https://api.github.com/users/bviglietta/gists{/gist_id}","starred_url":"https://api.github.com/users/bviglietta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bviglietta/subscriptions","organizations_url":"https://api.github.com/users/bviglietta/orgs","repos_url":"https://api.github.com/users/bviglietta/repos","events_url":"https://api.github.com/users/bviglietta/events{/privacy}","received_events_url":"https://api.github.com/users/bviglietta/received_events","type":"User","site_admin":false},"body":"I also did a little bit of refactoring of CoreLocation to reduce code duplication.","created_at":"2017-04-11T22:42:36Z","updated_at":"2017-04-12T18:03:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcf14180393878594254f90f9e30a19204f9abb6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497/commits","review_comments_url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497/comments","review_comment_url":"https://api.github.com/repos/Microsoft/WinObjC/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/2497/comments","statuses_url":"https://api.github.com/repos/Microsoft/WinObjC/statuses/22afc219c803f796859b0aba6162f0d63f151c06","head":{"label":"bviglietta:LocationWinRT","ref":"LocationWinRT","sha":"22afc219c803f796859b0aba6162f0d63f151c06","user":{"login":"bviglietta","id":7670607,"avatar_url":"https://avatars3.githubusercontent.com/u/7670607?v=3","gravatar_id":"","url":"https://api.github.com/users/bviglietta","html_url":"https://github.com/bviglietta","followers_url":"https://api.github.com/users/bviglietta/followers","following_url":"https://api.github.com/users/bviglietta/following{/other_user}","gists_url":"https://api.github.com/users/bviglietta/gists{/gist_id}","starred_url":"https://api.github.com/users/bviglietta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bviglietta/subscriptions","organizations_url":"https://api.github.com/users/bviglietta/orgs","repos_url":"https://api.github.com/users/bviglietta/repos","events_url":"https://api.github.com/users/bviglietta/events{/privacy}","received_events_url":"https://api.github.com/users/bviglietta/received_events","type":"User","site_admin":false},"repo":{"id":70083853,"name":"WinObjC","full_name":"bviglietta/WinObjC","owner":{"login":"bviglietta","id":7670607,"avatar_url":"https://avatars3.githubusercontent.com/u/7670607?v=3","gravatar_id":"","url":"https://api.github.com/users/bviglietta","html_url":"https://github.com/bviglietta","followers_url":"https://api.github.com/users/bviglietta/followers","following_url":"https://api.github.com/users/bviglietta/following{/other_user}","gists_url":"https://api.github.com/users/bviglietta/gists{/gist_id}","starred_url":"https://api.github.com/users/bviglietta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bviglietta/subscriptions","organizations_url":"https://api.github.com/users/bviglietta/orgs","repos_url":"https://api.github.com/users/bviglietta/repos","events_url":"https://api.github.com/users/bviglietta/events{/privacy}","received_events_url":"https://api.github.com/users/bviglietta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bviglietta/WinObjC","description":"Objective-C for Windows","fork":true,"url":"https://api.github.com/repos/bviglietta/WinObjC","forks_url":"https://api.github.com/repos/bviglietta/WinObjC/forks","keys_url":"https://api.github.com/repos/bviglietta/WinObjC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bviglietta/WinObjC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bviglietta/WinObjC/teams","hooks_url":"https://api.github.com/repos/bviglietta/WinObjC/hooks","issue_events_url":"https://api.github.com/repos/bviglietta/WinObjC/issues/events{/number}","events_url":"https://api.github.com/repos/bviglietta/WinObjC/events","assignees_url":"https://api.github.com/repos/bviglietta/WinObjC/assignees{/user}","branches_url":"https://api.github.com/repos/bviglietta/WinObjC/branches{/branch}","tags_url":"https://api.github.com/repos/bviglietta/WinObjC/tags","blobs_url":"https://api.github.com/repos/bviglietta/WinObjC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bviglietta/WinObjC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bviglietta/WinObjC/git/refs{/sha}","trees_url":"https://api.github.com/repos/bviglietta/WinObjC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bviglietta/WinObjC/statuses/{sha}","languages_url":"https://api.github.com/repos/bviglietta/WinObjC/languages","stargazers_url":"https://api.github.com/repos/bviglietta/WinObjC/stargazers","contributors_url":"https://api.github.com/repos/bviglietta/WinObjC/contributors","subscribers_url":"https://api.github.com/repos/bviglietta/WinObjC/subscribers","subscription_url":"https://api.github.com/repos/bviglietta/WinObjC/subscription","commits_url":"https://api.github.com/repos/bviglietta/WinObjC/commits{/sha}","git_commits_url":"https://api.github.com/repos/bviglietta/WinObjC/git/commits{/sha}","comments_url":"https://api.github.com/repos/bviglietta/WinObjC/comments{/number}","issue_comment_url":"https://api.github.com/repos/bviglietta/WinObjC/issues/comments{/number}","contents_url":"https://api.github.com/repos/bviglietta/WinObjC/contents/{+path}","compare_url":"https://api.github.com/repos/bviglietta/WinObjC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bviglietta/WinObjC/merges","archive_url":"https://api.github.com/repos/bviglietta/WinObjC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bviglietta/WinObjC/downloads","issues_url":"https://api.github.com/repos/bviglietta/WinObjC/issues{/number}","pulls_url":"https://api.github.com/repos/bviglietta/WinObjC/pulls{/number}","milestones_url":"https://api.github.com/repos/bviglietta/WinObjC/milestones{/number}","notifications_url":"https://api.github.com/repos/bviglietta/WinObjC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bviglietta/WinObjC/labels{/name}","releases_url":"https://api.github.com/repos/bviglietta/WinObjC/releases{/id}","deployments_url":"https://api.github.com/repos/bviglietta/WinObjC/deployments","created_at":"2016-10-05T17:41:41Z","updated_at":"2016-10-05T17:42:00Z","pushed_at":"2017-04-12T00:22:42Z","git_url":"git://github.com/bviglietta/WinObjC.git","ssh_url":"git@github.com:bviglietta/WinObjC.git","clone_url":"https://github.com/bviglietta/WinObjC.git","svn_url":"https://github.com/bviglietta/WinObjC","homepage":"","size":345437,"stargazers_count":0,"watchers_count":0,"language":"Objective-C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Microsoft:develop","ref":"develop","sha":"84fb1ff73dd5f8e0f17a2f5e7365c78889841f68","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars1.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":37950166,"name":"WinObjC","full_name":"Microsoft/WinObjC","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars1.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/WinObjC","description":"Objective-C for Windows","fork":false,"url":"https://api.github.com/repos/Microsoft/WinObjC","forks_url":"https://api.github.com/repos/Microsoft/WinObjC/forks","keys_url":"https://api.github.com/repos/Microsoft/WinObjC/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/WinObjC/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/WinObjC/teams","hooks_url":"https://api.github.com/repos/Microsoft/WinObjC/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/WinObjC/events","assignees_url":"https://api.github.com/repos/Microsoft/WinObjC/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/WinObjC/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/WinObjC/tags","blobs_url":"https://api.github.com/repos/Microsoft/WinObjC/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/WinObjC/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/WinObjC/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/WinObjC/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/WinObjC/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/WinObjC/languages","stargazers_url":"https://api.github.com/repos/Microsoft/WinObjC/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/WinObjC/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/WinObjC/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/WinObjC/subscription","commits_url":"https://api.github.com/repos/Microsoft/WinObjC/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/WinObjC/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/WinObjC/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/WinObjC/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/WinObjC/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/WinObjC/merges","archive_url":"https://api.github.com/repos/Microsoft/WinObjC/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/WinObjC/downloads","issues_url":"https://api.github.com/repos/Microsoft/WinObjC/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/WinObjC/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/WinObjC/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/WinObjC/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/WinObjC/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/WinObjC/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/WinObjC/deployments","created_at":"2015-06-23T23:14:58Z","updated_at":"2017-04-12T15:11:09Z","pushed_at":"2017-04-12T17:51:29Z","git_url":"git://github.com/Microsoft/WinObjC.git","ssh_url":"git@github.com:Microsoft/WinObjC.git","clone_url":"https://github.com/Microsoft/WinObjC.git","svn_url":"https://github.com/Microsoft/WinObjC","homepage":"","size":382278,"stargazers_count":5678,"watchers_count":5678,"language":"Objective-C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":747,"mirror_url":null,"open_issues_count":367,"forks":747,"open_issues":367,"watchers":5678,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497"},"html":{"href":"https://github.com/Microsoft/WinObjC/pull/2497"},"issue":{"href":"https://api.github.com/repos/Microsoft/WinObjC/issues/2497"},"comments":{"href":"https://api.github.com/repos/Microsoft/WinObjC/issues/2497/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/WinObjC/pulls/2497/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/WinObjC/statuses/22afc219c803f796859b0aba6162f0d63f151c06"}}}}
{"actor":{"display_login":"msft-Jeyaram"}}