AutocompleteOptions

public struct AutocompleteOptions

Defines the parameters of an Autocomplete Search.

Lifecycle

  • Declaration

    Swift

    public init(
        query: String,
        locale: Locale = Locale.current,
        limit: Int = Defaults.limit,
        position: CLLocationCoordinate2D? = nil,
        radius: Measurement<UnitLength>? = nil,
        countries: Set<String> = [],
        resultTypes: Set<AutocompleteResultType> = [],
        sessionID: UUID? = nil
    )

    Parameters

    query

    A search phrase to find an autocomplete text for.

    locale

    Locale in which autocomplete results should be returned. Locale should be created with one of the TomTom supported IETF language tags: https://developer.tomtom.com/search-api/documentation/product-information/supported-languages

    limit

    Limits the number of autocomplete suggestions.

    position

    When position is used on its own, results nearer the location will be boosted. When used in combination with radius, results will be constrained to the defined area.

    radius

    A radius that defines an area around position.

    countries

    A list of country codes in the ISO 3166-1 alpha-2 format. When used the results will be limited to the specified countries.

    resultTypes

    Defines the types of results to return.

    sessionID

    A search session during which a user performs multiple search requests. This is needed for sending the feedback to the online search engine.

Public

  • Defines default parameters for AutocompleteOptions

    See more

    Declaration

    Swift

    public enum Defaults
  • A search phrase to find an autocomplete text for.

    Declaration

    Swift

    public let query: String
  • Locale in which autocomplete results should be returned. Locale should be created with one of the TomTom supported IETF language tags: https://developer.tomtom.com/search-api/documentation/product-information/supported-languages

    Declaration

    Swift

    public let locale: Locale
  • Limits the number of autocomplete suggestions.

    Declaration

    Swift

    public var limit: Int?
  • When position is used on its own, results nearer the location will be boosted. When used in combination with radius, results will be constrained to the defined area.

    Declaration

    Swift

    public var position: CLLocationCoordinate2D?
  • A radius that defines an area around position.

    Declaration

    Swift

    public var radius: Measurement<UnitLength>?
  • A set of country codes in the ISO 3166-1 alpha-2 format limiting the autocomplete results. When used the results will be limited to the specified countries.

    Declaration

    Swift

    public var countries: Set<String>
  • Defines the types of results to return.

    Declaration

    Swift

    public var resultTypes: Set<AutocompleteResultType>
  • A search session during which a user performs multiple search requests. This is needed for sending the feedback to the online search engine.

    Declaration

    Swift

    public let sessionID: UUID?