Instance Property


The search string for which you want completions.


var queryFragment: String { get set }


Assigning a string to this property initiates a search based on that string. The completer object waits a short amount of time before initiating new searches. This delay gives you enough time to update the search string based on typed input from the user. For example, if you are using a text field to manage the input from the user, you could use the textField(_:shouldChangeCharactersIn:replacementString:) method of the text field’s delegate to update the value of this property, as shown in the following example.

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range
         replacementString:(NSString *)string {
    self.completer.queryFragment = textField.text;
    return YES;

See Also

Specifying the Query Attributes

var region: MKCoordinateRegion

The region that defines the geographic scope of the search.

var resultTypes: MKLocalSearchCompleter.ResultType

The types of search completions to include.

var pointOfInterestFilter: MKPointOfInterestFilter?

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

var filterType: MKLocalSearchCompleter.FilterType

The filter options for the search results.

struct MKLocalSearchCompleter.ResultType

Options that indicate types of search completions.