Search
public protocol SearchDefines common interface to provide search functionality.
- 
                  
                  This method provides the capability to search places and POIs meeting various criteria. DeclarationSwift @discardableResult func search(options: SearchOptions, completion: @escaping (Result<SearchResponse, Error>) -> ()) -> CancellableParametersoptionsThe SearchOptionsstructure to limit the results.completionThe completion closure is called after the request response is processed. If no errors occurred, SearchResponsecontains an array of search results and summary information. If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  
                  The Autocomplete Search feature can predict what a user is searching. The prediction is based on what they have already typed into the search field. It can identify entities within a user’s input and suggest them as potential search queries. This feature optimizes the accuracy of the search results by offering relevant suggestions and completing the user’s input. Use Autocomplete Search to elevate your application by delivering swift, error-free searches, thus enhancing efficiency. This feature also stimulates user exploration, fostering engagement. Example of an Autocomplete request to query “mar” for Amstardam in 100-km radius: let options = AutocompleteOptions( query: "mar", position: .AMSTERDAM, radius: Measurement(value: 100, unit: .kilometers) ) search.autocomplete(options: options) { result in if case let .success(response) = result { print("Autocomplete suggestions for query: \(response.summary.query)") response.results.forEach { result in result.segments.forEach { segment in switch segment { case .brand(let brand): print("\(brand.brand.name) - brand") case .poiCategory(let category): print("\(category.poiCategory.name) - category") case .plainText(let text): print("\(text.plainText) - text") @unknown default: print("unknown") } } } } } // Prints: // Autocomplete suggestions for query: mar // Market - category // Marqt - brand // Marina - category // Marriott - brandDeclarationSwift @discardableResult func autocomplete( options: AutocompleteOptions, completion: @escaping (Result<AutocompleteResponse, Error>) -> () ) -> CancellableParametersoptionsThe AutocompleteOptionsstructure to make the results more relevant.completionThe completion closure is called after the response to the request is processed. If no errors occurred, AutocompleteResponsecontains proposed autocomplete elements, that can be used to implement an input field with the autocomplete feature. If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  
                  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.DeclarationSwift @discardableResult func requestPOICategories( options: POICategoryOptions, completion: @escaping (Result<POICategoryResponse, Error>) -> () ) -> CancellableParametersoptionsThe POICategoryOptionsstructure to limit the results.completionThe completion closure is called after the response to the request is processed. If no errors occurred, POICategoryResponsecontains an array of categories and subcategories together with their translations and synonyms. If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  
                  Provides detailed information about a POI based on its identifier (entityId). DeclarationSwift @discardableResult func requestPOIDetails( options: POIDetailsOptions, completion: @escaping (Result<TomTomSDKSearch.POIDetailsResponse, Error>) -> () ) -> CancellableParametersoptionsDescribes 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 If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  
                  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. DeclarationSwift @discardableResult func requestGeometryData( options: GeometryDataOptions, completion: @escaping (Result<GeometryDataResponse, Error>) -> () ) -> CancellableParametersoptionsDefine geometries to request. completionParameter completion: The completion closure is called after the response to the request is processed. If no errors occurred, GeometryDataResponsecontains an array of geometries data structure. If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  
                  Asynchronously sends a feedback event for the search. DeclarationSwift @discardableResult func sendFeedback(feedbackEvent: FeedbackEvent, completion: ((Error?) -> ())?) -> CancellableParametersfeedbackEventThe feedback event. completionIf an error occurred, completionis called with error. If cancellation is triggered, the completion returns a cancellation error. Sometimes, the completion may return with other work before acknowledging the cancellation.Return Valuea Cancellableinstance that provides control for request cancellation.
- 
                  evSearch(options:Default implementationcompletion: ) This method provides the capability to search EV charging stations meeting various criteria. Example of an evsearch request to query available charging stations for Amstardam in 1-km radius: let options = EVSearchOptions(geoBias: .AMSTERDAM, radius: .tt.meters(1000), status: .available) search.evSearch(options: options) { result in switch result { case let .failure(error): print(error) case let .success(response): print(response.results) } }Important This is a Public Preview API. It may be changed or removed at any time.Default ImplementationThis method provides the capability to search EV charging stations meeting various criteria. Important This is a Public Preview API. It may be changed or removed at any time.DeclarationSwift @discardableResult func evSearch(options: EVSearchOptions, completion: @escaping (Result<EVSearchResponse, Error>) -> ()) -> CancellableParametersoptionsThe EVSearchOptionsstructure to limit the results.completionThe completion closure is called after the request response is processed. If no errors occurred, EVSearchResponsecontains an array of search results. If cancellation is triggered, the completion returns a cancellation error.Return Valuea Cancellableinstance that provides control for request cancellation.
 
         TomTom SDK for iOS (0.53.1)
 
          TomTom SDK for iOS (0.53.1)
         Search
          Search