TomTomSDKSearch
-
A single custom POI that can be injected into the search engine.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public final class CustomPOI
-
Allows injecting custom POI data into the search engine.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
final public class CustomPOIProvider
-
Defines the parameters of the Autocomplete Search. Use
AutocompleteOptions
to make an Autocomplete Search request. To learn more about Autocomplete refer to theautocomplete(options:completion:)
description.You can also provide optional parameters to perform a more accurate search, following similar recommendation as for
search(options:completion:)
. An example of autocomplete searching for a restaurant in Amsterdam:
See morelet amsterdam = CLLocationCoordinate2D(latitude: 52.369979, longitude: 4.891820) let options = AutocompleteOptions( query: "Rest", position: amsterdam, radius: Measurement(value: 3, unit: .kilometers), countries: ["NL"], resultTypes: [.brand, .category], sessionID: UUID().uuidString )
Declaration
Swift
public struct AutocompleteOptions
-
The type of autocomplete result.
See moreDeclaration
Swift
public enum AutocompleteResultType
-
Feedback event type that describes the user actions performed on a specific search result.
See moreDeclaration
Swift
public enum FeedbackEventType
-
Factory for creating different kinds of instances of
See moreFeedbackResultID
.Declaration
Swift
public enum FeedbackResultIDFactory
-
Identifies the search result for which a [feedback event][FeedbackEvent] is posted.
See moreDeclaration
Swift
public protocol FeedbackResultID
-
Feedback event describing user interactions with the search results. The client application can report these events back to the search service to be used for analyzing and improving the search service.
See moreDeclaration
Swift
public struct FeedbackEvent
-
Specifies the parameters of the geometries to query.
See moreDeclaration
Swift
public struct GeometryDataOptions
-
Specifies the language and scope of POI categories.
See moreDeclaration
Swift
public struct POICategoryOptions
-
Circle geometry for searchArea.
See moreDeclaration
Swift
public struct CircleGeometry : Hashable, Equatable
-
Polygon geometry for searchArea.
See moreDeclaration
Swift
public struct PolygonGeometry : Equatable, Hashable
-
Rectangle geometry for searchArea.
See moreDeclaration
Swift
public struct RectangleGeometry : Hashable
-
Specifies fuzzy search options.
See moreDeclaration
Swift
public struct SearchOptions
-
Represents the response of the Autocomplete Search API, containing a summary and a list of autocomplete results.
autocomplete(options:completion:)
usesAutocompleteResponse
to encapsulate the results for an autocomplete request.An example usage of
AutocompleteResponse
:
See morelet options = AutocompleteOptions( query: "mar", position: .AMSTERDAM, radius: Measurement(value: 100, unit: .kilometers) ) search.autocomplete(options: options) { result in switch result { case let .success(response): 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) - plain text") @unknown default: print("unknown") } } } case let .failure(error): print("Handle error: \(error)" ) } } // Prints: // Market - category // Marqt - brand // Marina - category // Marriott - brand
Declaration
Swift
public class AutocompleteResponse
-
AutocompleteSummary
provides information about an autocomplete request that was performed.This class is part of the
See moreAutocompleteResponse
definition. It contains the query phrase and geo-bias information.Declaration
Swift
public class AutocompleteSummary
-
AutocompleteGeoBias
represents geographical bias used by the autocomplete engine to improve search results.AutocompleteGeoBias
is part of the definition forAutocompleteSummary
which is returned from theSearch.autocomplete(options:completion:)
method.Fox example, for the geobias Amsterdam query “Fie” can return the autocomplete result “Fietsenwinkel.nl”, for the geobias Berlin query “Fie” can return the autocomplete result “Fielmann”.
See moreDeclaration
Swift
public class AutocompleteGeoBias
-
The result returned by the autocomplete search.
An
AutocompleteResult
object includes an array of segments that correspond to recognized entities. These entities can bebrand
,poiCategory
, orplainText
.When the query contains multiple recognized entities, a single autocomplete result may contain multiple segments. For instance, if a user enters the query “Chess Bis,” the autocomplete search result could include 2 segments: a plain text segment containing “Chess” and a category segment with “Bistro.”
Instances of this class are utilized as components of the
See moreSearch.autocomplete(options:completion:)
method, accessible through theAutocompleteResponse.results
property.Declaration
Swift
public class AutocompleteResult
-
AutocompleteSegment
represents an entity found within the autocomplete search term.An entity can be a brand, a point of interest (POI) category, or plain text. Every case has a corresponding associated object. This enum is used in
AutocompleteResult
to describe the matched entities returned from the autocomplete search.An example of handling segments:
See morelet options = AutocompleteOptions( query: "mar", position: .AMSTERDAM, radius: Measurement(value: 100, unit: .kilometers), countries: ["NL"] ) search.autocomplete(options: options) { result in if case let .success(response) = result { response.results.forEach { result in result.segments.forEach { segment in switch segment { case .brand(let brand): print("Brand: \(brand.brand.name)") case .poiCategory(let category): print("Category: \(category.poiCategory.name)") case .plainText(let text): print("Text: \(text.plainText)") @unknown default: print("unknown") } } } } } // Prints: // Category: Market // Brand: Marqt // Category: Marina // Brand: Marriott
Declaration
Swift
public enum AutocompleteSegment
-
Represents a recognized autocomplete result defined by a
Brand
(e.g., “BMW” car brand).Use provided
Brand
in theSearchOptions.brands
to continue searching for places with the given brand.AutocompleteSegmentBrand
is part of theAutocompleteSegment
definition to describe brand-related information in the autocomplete search results.For example the query “BM” can return an autocomplete search result with the brand segment and the query “BMW”.
See moreDeclaration
Swift
public struct AutocompleteSegmentBrand
-
AutocompleteSegmentPOICategory
represents a point of interest (POI) category segment in the autocomplete search results.A POI category segment contains a
See morePOICategory
, which can be used as a filter in thesearch
method to refine search results based on the POI category information. It also includes an optionalmatchedAlternativeName
to provide an alternative name for the matched POI category, if available. This structure is used inAutocompleteSegment
to describe POI category-related information in the autocomplete search results.Declaration
Swift
public struct AutocompleteSegmentPOICategory
-
Represents the autocomplete result value that doesn’t match any brand or POI Category.
The
See moreplainText
can be used as a query string in theSearchOptions
to continue the search. It is used inAutocompleteSegment
to provide plain text-related information in the autocomplete search results. For example the query “Chess” can return an autocomplete search result with the plain text segment and the query “Chess”.Declaration
Swift
public struct AutocompleteSegmentPlainText
-
A structure enclosing related data IDs.
See moreDeclaration
Swift
public struct SearchResultID
-
A container for the identifier of charging availability.
See moreDeclaration
Swift
public struct EVChargingAvailabilityID
-
A container for parking detail identifier.
See moreDeclaration
Swift
public struct ParkingDetailID
-
A container for the fuel price identifier
See moreDeclaration
Swift
public struct FuelPriceID
-
The type of search result.
Declaration
Swift
public typealias SearchResultType = SearchResult.Type
-
Declaration
Swift
extension SearchResultType: CustomStringConvertible
-
SearchResult Object containing grouped information about places or points of interest.
See moreDeclaration
Swift
public struct SearchResult
-
GeometryDataResponse
See moreDeclaration
Swift
public struct GeometryDataResponse
-
Structure containing POI category response.
See moreDeclaration
Swift
public struct POICategoryResponse
-
The result returned by
See moreSearch.requestPOIDetails(options:completion:)
.Declaration
Swift
public struct POIDetailsResponse
-
Summary information about the search that was performed.
Declaration
Swift
public typealias SearchRequestSummary = SearchResponse.Summary
-
A response structure that contains search results for the requested search query.
See moreDeclaration
Swift
public struct SearchResponse