<!--
{
  "availability" : [
    "iOS: 9.3.0 -",
    "iPadOS: 9.3.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.4 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKLocalSearchCompleter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKLocalSearchCompleter"
  },
  "title" : "MKLocalSearchCompleter"
}
-->

# MKLocalSearchCompleter

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

```
class MKLocalSearchCompleter
```

## Overview

You use an [`MKLocalSearchCompleter`](/documentation/MapKit/MKLocalSearchCompleter) object to retrieve auto-complete suggestions for your own map-based search controls. As the user types text, you feed the current text string into the search completer object, which delivers possible string completions that match locations or points of interest.

You create and configure [`MKLocalSearchCompleter`](/documentation/MapKit/MKLocalSearchCompleter) objects yourself. You must always assign a delegate object to the search completer so that you can receive the search results that it generates. Specify a search region to restrict results to a designated area. The following code shows a simple example of a view controller that stores the [`MKLocalSearchCompleter`](/documentation/MapKit/MKLocalSearchCompleter) object in a property. The view controller itself acts as the delegate for the completer and the view controller uses the region associated with an [`MKMapView`](/documentation/MapKit/MKMapView) object that’s part of the view controller’s interface. Completer objects are long-lived objects, so you can store strong references to them and reuse them later in your code.

Listing 1. Creating and configuring a search completer

```objc
- (void)viewDidLoad {
   [super viewDidLoad];
 
   self.completer = [[MKLocalSearchCompleter alloc] init];
   self.completer.delegate = self;
 
   // Limit search results to the map view's current region.
   self.completer.region = self.myMapView.region;
}
```

Update the value of the completer’s [`queryFragment`](/documentation/MapKit/MKLocalSearchCompleter/queryFragment) property to begin a search query. You can update this property in real time as the user types new characters into a text field because the completer object waits a short amount of time for the query string to stabilize. When modifications to the query string stop, the completer initiates a new search and returns the results to your delegate as an array of [`MKLocalSearchCompletion`](/documentation/MapKit/MKLocalSearchCompletion) objects.

## Topics

### Receiving the search results

[`delegate`](/documentation/MapKit/MKLocalSearchCompleter/delegate)

The object that receives the completion results.

[`MKLocalSearchCompleterDelegate`](/documentation/MapKit/MKLocalSearchCompleterDelegate)

Methods the delegate calls with search completion data.

### Specifying the query attributes

[`addressFilter`](/documentation/MapKit/MKLocalSearchCompleter/addressFilter)

A filter that lists which address options to include or exclude in search results.

[`queryFragment`](/documentation/MapKit/MKLocalSearchCompleter/queryFragment)

The search string that you want completions for.

[`region`](/documentation/MapKit/MKLocalSearchCompleter/region)

The region that defines the geographic scope of the search.

[`regionPriority`](/documentation/MapKit/MKLocalSearchCompleter/regionPriority)

A value that indicates the importance of the configured region.

[`resultTypes`](/documentation/MapKit/MKLocalSearchCompleter/resultTypes)

The types of search completions to include.

[`pointOfInterestFilter`](/documentation/MapKit/MKLocalSearchCompleter/pointOfInterestFilter)

A filter that lists point of interest categories to include or exclude in the search.

[`filterType`](/documentation/MapKit/MKLocalSearchCompleter/filterType-swift.property)

The filter options for the search results.

[`FilterType`](/documentation/MapKit/MKLocalSearchCompleter/FilterType-swift.enum)

Constants indicating the types of search completions to return.

[`ResultType`](/documentation/MapKit/MKLocalSearchCompleter/ResultType)

Options that indicate types of search completions.

### Canceling the query

[`-  cancel`](/documentation/MapKit/MKLocalSearchCompleter/cancel())

Cancels an in-progress search operation.

[`searching`](/documentation/MapKit/MKLocalSearchCompleter/isSearching)

A Boolean value that indicates whether a search operation is in progress.

### Getting the current query results

[`results`](/documentation/MapKit/MKLocalSearchCompleter/results)

The most recently received search completions.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)