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.
    See more

    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.
    See more

    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 the autocomplete(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:

    let 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
     )
    
    See more

    Declaration

    Swift

    public struct AutocompleteOptions
  • The type of autocomplete result.

    See more

    Declaration

    Swift

    public enum AutocompleteResultType
  • Defines the parameters of an Electric Vehicle (EV) search.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct EVSearchOptions
  • Feedback event type that describes the user actions performed on a specific search result.

    See more

    Declaration

    Swift

    public enum FeedbackEventType
  • Identifies the search result for which a [feedback event][FeedbackEvent] is posted.

    See more

    Declaration

    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 more

    Declaration

    Swift

    public struct FeedbackEvent
  • Specifies the parameters of the geometries to query.

    See more

    Declaration

    Swift

    public struct GeometryDataOptions
  • Specifies the language and scope of POI categories.

    See more

    Declaration

    Swift

    public struct POICategoryOptions
  • The protocol used to specify searchArea in SearchOptions

    See more

    Declaration

    Swift

    public enum Geometry : Hashable
  • Circle geometry for searchArea.

    See more

    Declaration

    Swift

    public struct CircleGeometry : Hashable, Equatable
  • Specifies the type of result sorting.

    See more

    Declaration

    Swift

    public enum SortOrder
  • Represents the response of the Autocomplete Search API, containing a summary and a list of autocomplete results.

    autocomplete(options:completion:) uses AutocompleteResponse to encapsulate the results for an autocomplete request.

    An example usage of AutocompleteResponse:

    let 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
    
    See more

    Declaration

    Swift

    public class AutocompleteResponse
  • AutocompleteSummary provides information about an autocomplete request that was performed.

    This class is part of the AutocompleteResponse definition. It contains the query phrase and geo-bias information.

    See more

    Declaration

    Swift

    public class AutocompleteSummary
  • AutocompleteGeoBias represents geographical bias used by the autocomplete engine to improve search results.

    AutocompleteGeoBias is part of the definition for AutocompleteSummary which is returned from the Search.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 more

    Declaration

    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 be brand, poiCategory, or plainText.

    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 Search.autocomplete(options:completion:) method, accessible through the AutocompleteResponse.results property.

    See more

    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:

    let 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
    
    
    See more

    Declaration

    Swift

    public enum AutocompleteSegment
  • Represents a recognized autocomplete result defined by a Brand (e.g., “BMW” car brand).

    Use provided Brand in the SearchOptions.brands to continue searching for places with the given brand. AutocompleteSegmentBrand is part of the AutocompleteSegment 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 more

    Declaration

    Swift

    public struct AutocompleteSegmentBrand
  • AutocompleteSegmentPOICategory represents a point of interest (POI) category segment in the autocomplete search results.

    A POI category segment contains a POICategory, which can be used as a filter in the search method to refine search results based on the POI category information. It also includes an optional matchedAlternativeName to provide an alternative name for the matched POI category, if available. This structure is used in AutocompleteSegment to describe POI category-related information in the autocomplete search results.

    See more

    Declaration

    Swift

    public struct AutocompleteSegmentPOICategory
  • Represents the autocomplete result value that doesn’t match any brand or POI Category.

    The plainText can be used as a query string in the SearchOptions to continue the search. It is used in AutocompleteSegment 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”.

    See more

    Declaration

    Swift

    public struct AutocompleteSegmentPlainText
  • A structure enclosing related data IDs.

    See more

    Declaration

    Swift

    public struct SearchResultID
  • A container for parking detail identifier.

    See more

    Declaration

    Swift

    public struct ParkingDetailID
  • A container for the fuel price identifier

    See more

    Declaration

    Swift

    public struct FuelPriceID
  • SearchResult Object containing grouped information about places or points of interest.

    See more

    Declaration

    Swift

    public struct SearchResult
  • A response structure that contains EV search results.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct EVSearchResponse
  • A response structure that contains EV search results.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct EVSearchResult
  • Structure containing POI category details.

    See more

    Declaration

    Swift

    public struct POICategory
  • Defines essential parameters to fetch POI details data.

    See more

    Declaration

    Swift

    public struct POIDetailsOptions
  • Defines common interface to provide search functionality.

    See more

    Declaration

    Swift

    public protocol Search