0

I need to get all possible location from given string, I know its available in Google API, but I want in apple native API. I have tried following 2 codes, but both are return only one location, but need all possible solution for given input. It is available in iOS API ? Please help me to solve this.

Code 1 :

CLGeocoder *geocoder = [[CLGeocoder alloc] init];
   [geocoder geocodeAddressString:address completionHandler:^(NSArray* placemarks, NSError* error){
       dispatch_async(dispatch_get_main_queue(), ^{
       NSLOG(@"Count %d",placemarks.count);
       [self.tableView reloadData];
       });
   }];

Code 2 :

MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = address;
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse * _Nullable response, NSError * _Nullable error) {
       NSLOG(@"Count %d",response.mapItems.count);
        [self.tableView reloadData];
}];

please checkmap search the image , i need all possible "placemarks" like attachment

Ammaiappan
  • 539
  • 3
  • 22

0 Answers0