A utility object for initiating map-based searches and processing the results.


class MKLocalSearch : NSObject


Use an MKLocalSearch object to execute a single search request. You might use this class to search for addresses or points of interest on the map. Upon completion of the request, the object delivers the results to the completion handler that you provide.


Creating a Search Request

init(request: MKLocalSearch.Request)

Initializes and returns a search object configured with the specified parameters.

class MKLocalSearch.Request

The parameters to use when searching for points of interest on the map.

struct MKLocalSearch.ResultType

Options that indicate types of search results.


Performing the Search

func start(completionHandler: MKLocalSearch.CompletionHandler)

Starts the search and delivers the results to the specified completion handler.

typealias MKLocalSearch.CompletionHandler

A completion handler block for a search operation.

var isSearching: Bool

A Boolean indicating whether the search is currently in progress.

func cancel()

Cancels an in-progress search operation.

Getting Search Results

class MKLocalSearch.Response

The results from a map-based search.


Inherits From

Conforms To

See Also

Placemark and Local Search

Searching for Nearby Points of Interest

Provide automatic search completions based on a user’s partial search query, and search the map for relevant locations nearby.

class MKPlacemark

A user-friendly description of a location on the map.

struct MKLocalSearch.ResultType

Options that indicate types of search results.

class MKLocalSearchCompleter

A utility object for generating a list of completion strings based on a partial search string that you provide.

struct MKLocalSearchCompleter.ResultType

Options that indicate types of search completions.

class MKLocalSearchCompletion

A fully formed string that completes a partial string.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software