iOS search api for Apple Maps

117 Views Asked by At

Is there a search API for Apple Maps? Like in Apple Maps, if you start typing an address, it filters the list with some possibilities. Is this available to developers? I saw that they added some MKLocalSearch in iOS 7, but I could not find anything that gives that capability.

1

There are 1 best solutions below

0
On BEST ANSWER

MKLocalSearch with MKLocalSearchRequest is exactly what you are looking for. A basic search can be done as follows:

MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
        request.naturalLanguageQuery = @"some address";

MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:request];
[localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
           // do stuff with the response
        }];

This should put you on the right path. Read the docs for MKLocalSearch, MKLocalSearchRequest, and MKLocalSearchResponse.