iOS Developer Library

Developer

MapKit Framework Reference MKLocalSearchRequest Class Reference

Options
Deployment Target:

On This Page
Language:

MKLocalSearchRequest

An MKLocalSearchRequest object is a utility object that you use to specify map-based search parameters. After creating an instance of this object, you can assign a natural language string containing the address or point-of-interest to search for. You can also specify a specific map region to narrow the search results. You then use the configured object to initialize an MKLocalSearch object and perform your search.

Inheritance


Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 6.1 and later.
  • A string containing the desired search item.

    Declaration

    Swift

    var naturalLanguageQuery: String!

    Objective-C

    @property(nonatomic, copy) NSString *naturalLanguageQuery

    Discussion

    You specify this parameter as a string describing the map-based item you want to look for. The text is equivalent to what the user would type in a search field in the Maps app. For example, the text might contain all or part of an address or it might contain the name of a point of interest.

    This property can not be nil.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 6.1 and later.

  • region region Property

    A map region that provides a hint as to where to search.

    Declaration

    Swift

    var region: MKCoordinateRegion

    Objective-C

    @property(nonatomic, assign) MKCoordinateRegion region

    Discussion

    You can use this parameter to narrow the list of search results to those inside or close to the specified region. Specifying a region does not guarantee that the results will all be inside the region. It is merely a hint to the search engine.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 6.1 and later.