Search
public protocol Search
Defines common interface to provide search functionality.
-
This method provides the capability to search places and POIs meeting various criteria.
Declaration
Swift
func search(options: SearchOptions, completion: @escaping (Result<SearchResponse, Error>) -> ())Parameters
optionsThe
SearchOptionsstructure to limit the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
SearchResponsecontains an array of search results and summary information. -
The Autocomplete API enables you to make a more meaningful Search API call by recognizing entities inside an input query and offering them as query terms.
Declaration
Swift
func autocomplete(options: AutocompleteOptions, completion: @escaping (Result<AutocompleteResponse, Error>) -> ())Parameters
optionsThe
AutocompleteOptionsstructure to limit the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
AutocompleteResponsecontains proposed autocomplete elements, that can be used to implement an input field with the autocomplete feature. -
This method provides a full list of POI categories and subcategories together with their translations and synonyms. Additional POI category parameters like language can be taken into account using the
POICategoryOptions.Declaration
Swift
func requestPOICategories(options: POICategoryOptions, completion: @escaping (Result<POICategoryResponse, Error>) -> ())Parameters
optionsThe
POICategoryOptionsstructure to limit the results.completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
POICategoryResponsecontains an array of categories and subcategories together with their translations and synonyms. -
Provides detailed information about a POI based on its identifier (entityId).
Declaration
Swift
func requestPOIDetails( options: POIDetailsOptions, completion: @escaping (Result<TomTomSDKSearch.POIDetailsResponse, Error>) -> () )Parameters
optionsDescribes what POI Details data to request.
completionThe completion closure is called after the response to the request has been processed. If no errors occurred,
PoiDetailsResponsecontains the requested search result with POI info -
The Geometry Data API returns sets of coordinates that represent the outline of a city, country, or land area. The method supports batch requests of up to 20 identifiers.
Declaration
Swift
func requestGeometryData(options: GeometryDataOptions, completion: @escaping (Result<GeometryDataResponse, Error>) -> ())Parameters
optionsDefine geometries to request.
completionParameter completion: The completion closure is called after the response to the request has been processed. If no errors occurred,
GeometryDataResponsecontains an array of geometries data structures -
Asynchronously sends a feedback event for the search.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func sendFeedback(feedbackEvent: FeedbackEvent, completion: ((Error?) -> ())?)Parameters
feedbackEventThe feedback event.
completionIf an error occurred,
completionis called with error.
Search Protocol Reference