TomTomSDKCommon

ConformanceLock

  • A class for restricting protocol conformance to TomTomSDK components.

    Important

    This class should not be instantiated by any other framework except TomTom components. The API and runtime stability aren’t guaranteed otherwise.

    Important

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

    Declaration

    Swift

    public final class ConformanceLock<T>

ConformanceLocked

  • Protocols that inherit this protocol are considered locked and can be conformed to and implemented only inside the TomTomSDK.

    Important

    This protocol should not be implemented by any other framework except TomTom components. The source and runtime stability aren’t guaranteed otherwise.

    Note

    to test code that depends on APIs that conform to ConformanceLocked, isolate these APIs with an additional abstraction (wrapper). Build your implementation with this abstraction as a dependency. Here is a way to do it by creating an additional protocol:
    // An example of protocol that provides necessary functionality in the TomTomSDK.
    public protocol Planner: ConformanceLocked {
        func plan()
    }
    
    // An abstraction from the client side that provides the same interface but is not locked.
    // Every TomTomSDK protocol might need this protocol clone.
    // Use this type to pass it in the application and in tests.
    protocol ClientPlanner {
       // The method should have the same signature
       func plan()
    }
    
    // Wrapper implementation on the client side that will contain TomTomSDK dependency
    // but conform to the non-locked protocol
    class ClientWrapperPlanner: ClientPlanner {
        let planner: Planner
        init(_ planner: Planner) {
            self.planner = planner
        }
    
        func plan() {
            planner.plan()
        }
    }
    
    // An example of the production code that needs to be tested.
    // Use `ClientPlanner` in your production code, so you can mock it.
    struct PlannerViewModel {
       init(_ planner: ClientPlanner) { }
       //
       // ...
    }
    
    // In production code
    let planner: Planner = ... // getting real planner
    PlannerViewModel(ClientWrapperPlanner(planner))
    
    By depending on `ClientPlanner` a `PlannerViewModel` instance can be tested
    by mocking all its dependencies. To mock its dependencies, replace `ClientWrapperPlanner` with a
    mocked implementation of `ClientPlanner`.
    

    Important

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

    Declaration

    Swift

    public protocol ConformanceLocked

ConnectorDetails

ConnectorType

CurrentType

  • Describes the type of electric current

    See more

    Declaration

    Swift

    public enum CurrentType

VoltageRange

  • Specifies the minimum (inclusive) and maximum (exclusive) voltage values. The lower bound value should be a non-negative number (positive or zero). The upper bound value should be greater than the lower bound, or if set to zero, it will be treated as infinity. If not specified, a range of [0, infinity] is assumed.

    Important

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

    Declaration

    Swift

    public struct VoltageRange : Equatable, Hashable
  • Defines publishable and subscribable action.

    Declaration

    Swift

    @available(*, deprecated, message: "This API is deprecated and will be removed with the next major release.")
    public protocol Event

UnitsSystem

  • Units system

    See more

    Declaration

    Swift

    public enum UnitsSystem : CaseIterable, Equatable

GeoJSON

  • Generic container for GeoJSON geometry types.

    GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). It defines several types of JSON objects and the manner in which they are combined to represent data about geographic features, their properties, and their spatial extents. For more info on the GeoJSON format see the following document.

    See more

    Declaration

    Swift

    public struct GeoJSON<T>
    extension GeoJSON: Equatable where T: Equatable

PointGeometry

Feature

  • The Feature structure encapsulates a GeoJSON Feature - a geospatial object with associated properties. GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. Features in GeoJSON contain a Geometry object and additional properties.

    See more

    Declaration

    Swift

    public struct Feature
    extension Feature: Equatable

GeoJSONGeometry

  • GeoJSONGeometry is an enumeration representing the seven geometry types defined in the GeoJSON format. Each case of the enum wraps a corresponding structure that provides detailed geometric data.

    See more

    Declaration

    Swift

    public enum GeoJSONGeometry
    extension GeoJSONGeometry: Equatable

GeoJSONPosition

  • Fundamental geometry construct. All other GeoJSON geometry types are built based on it.

    See more

    Declaration

    Swift

    public struct GeoJSONPosition
    extension GeoJSONPosition: Equatable

Encodable

LocalizedError

BoundingBox

  • The smallest rectangular area within which all the coordinates lie.

    See more

    Declaration

    Swift

    public struct BoundingBox : Equatable, Hashable

Geometry

  • The Geometry struct represents a single geometric entity according to the GeoJSON specification.

    See more

    Declaration

    Swift

    public struct Geometry
    extension Geometry: Equatable

GeometryCollection

  • The GeometryCollection struct represents a collection of Geometry objects as defined by the GeoJSON specification. It provides a way to group multiple geometries together, regardless of their types.

    See more

    Declaration

    Swift

    public struct GeometryCollection
    extension GeometryCollection: Equatable

GeometryData

  • GeoJSON represented by GeometryData.

    See more

    Declaration

    Swift

    public struct GeometryData

Address

  • A collection of information that describes geographical location

    See more

    Declaration

    Swift

    public struct Address : Equatable
  • Information on how much to charge at a charging station.

    See more

    Declaration

    Swift

    public struct ChargingInformation

FuelType

  • Defines fuel types supported in the fuzzy search.

    See more

    Declaration

    Swift

    public struct FuelType : Hashable
    extension FuelType: CustomDebugStringConvertible

OpeningHours

  • Defines the OpeningHours of a POI.

    See more

    Declaration

    Swift

    public struct OpeningHours

OpeningHoursMode

  • An option that defines for what days opening hours would be requested.

    See more

    Declaration

    Swift

    public enum OpeningHoursMode
    extension OpeningHoursMode: Equatable

POI

  • POI

    Point of Interest information for a search result.

    See more

    Declaration

    Swift

    public struct POI

Source

  • Defines the source of the produced search result.

    Note

    this information might be helful when different Search instances are used and there is a need to distinguish results based on their origin.
    See more

    Declaration

    Swift

    public enum Source

POIID

  • Defines the POI identifier (POIID) required to fetch POI details.

    See more

    Declaration

    Swift

    public struct POIID

ChargingPark

  • Contains information about an EV charging park.

    Important

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

    Declaration

    Swift

    public struct ChargingPark

Brand

  • Defines a POI brand.

    See more

    Declaration

    Swift

    public struct Brand : Hashable

POICategoryID

  • POI category ID.

    See more

    Declaration

    Swift

    public struct POICategoryID : Hashable
  • Defines standard the POI category identifiers. The enum value provides the semantic of the POI category. Multiple POICategoryID can have the same StandardCategoryID value.

    See more

    Declaration

    Swift

    public enum StandardCategoryID : Int

EntryPoint

  • A representation of an entry point for a POI.

    Important

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

    Declaration

    Swift

    public struct EntryPoint
    extension EntryPoint: Equatable

Place

  • Represents information about specific place.

    See more

    Declaration

    Swift

    public struct Place : Equatable

LoggerOutput

  • Protocol that defines log destination, such as file, console, etc.

    For more information on log configurator see LogConfigurator.

    For more information on log configuration see LogConfiguration.

    Important

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

    Declaration

    Swift

    public protocol LoggerOutput
  • Identifier of the map.

    Declaration

    Swift

    public protocol MapID
  • Position of the map.

    Note

    Do not implement this protocol. Use the TomTomSDK concrete class that implements this protocol.

    Declaration

    Swift

    public protocol MapPosition
  • A reference of a map ID and arc information.

    Declaration

    Swift

    public protocol MapReferences
  • Region ID for a region inside a map.

    Declaration

    Swift

    public protocol RegionID
  • Extending standard structures like Measurement with properties like var meters is convenient:

    • it avoids extracting value without explicit conversion to a certain unit
    • it simplifies getting value from an optional Measurement But it is also risky because these extensions might conflict with extensions from other libraries or Apple. This decorator mitigates the risk of conflicts while providing a short, readable code. Typical use cases are:
    • extracting value from a value representing a unit of measure: let optionalDistanceInMeters = distance?.tt.meters
    • performing computations on values representing units of measure: cumulativeDistance += anotherDistance.tt
    • comparing values representing units of measure: if delay < .tt.seconds(5) {}
    • combining value extraction and typecast: let intValue = distance.tt.intValue(in: .meters)
    See more

    Declaration

    Swift

    public struct MeasurementDecorator<UnitType> where UnitType : Unit

TTUnitElectricEfficiency

  • Unit specifying the electric efficiency, e.g., in kilowatt hours per kilometer.

    See more

    Declaration

    Swift

    public final class TTUnitElectricEfficiency : Dimension

TTUnitEnergyDensity

  • Unit specifying the energy density (of fuel). For example, energy density is 34.2 MJ/l for gasoline and 35.8 MJ/l for diesel fuel.

    See more

    Declaration

    Swift

    public final class TTUnitEnergyDensity : Dimension

TTUnitFuelPerTime

  • Unit specifying the fuel usage (of a vehicle) over time.

    See more

    Declaration

    Swift

    public final class TTUnitFuelPerTime : Dimension

TTUnitRatio

  • A quantity describing a ratio, also commonly used for probabilities. (For example, 10%.)

    Important

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

    Declaration

    Swift

    public final class TTUnitRatio : Dimension

MetadataProvider

  • MetadataProvider stores during app lifecycle additional metadata for HTTP requests to TomTom Network APIs and implements adding this additional metadata to HTTP request’s headers

    Important

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

    Declaration

    Swift

    public final class MetadataProvider

Observer

  • Any concrete observer should conform to this protocol so we can create a weak reference to it.

    Declaration

    Swift

    public protocol Observer : AnyObject

Observable

  • Observable is an interface for a container of observers. It allows sending notifications on certain events to all of the registered observers.

    We provide the implementation of this protocol: TomTomSDKCommon/ObservableHandler.

    See more

    Declaration

    Swift

    public protocol Observable

ObservableHandler

  • A thread-safe implementation of the Observable container.

    Any method can be called from any queue. The notification of observers, completions, and other closures will be executed on a dispatch queue provided in the init method.

    Note

    If you rely on the onLastObserverRemoved closure, call removeObserver(:) explicitly. If the observer is destroyed without an explicit call to removeObserver(:), the onLastObserverRemoved call will be delayed until the next notify event when we detect that the last observer is nil and remove it.
    See more

    Declaration

    Swift

    public final class ObservableHandler : Observable

DrivingSide

  • Indicates the driving side on the road.

    See more

    Declaration

    Swift

    public enum DrivingSide

NumberOfLanes

  • Total number of lanes on the road in both directions.

    See more

    Declaration

    Swift

    public struct NumberOfLanes : Equatable
  • A coarse-grained classification of roads according to road purpose and capacity. In general, it is associated with specific horizon data.

    See more

    Declaration

    Swift

    public enum RoadCategory

RoadClass

  • Indicates the class of a road.

    Important

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

    Declaration

    Swift

    public enum RoadClass

RoadCondition

RoadProperties

  • Provides information about the properties of the road at the current location.

    See more

    Declaration

    Swift

    public struct RoadProperties : Equatable

RoadSubClass

  • Indicates the subclass of a road.

    Important

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

    Declaration

    Swift

    public enum RoadSubClass

RoadType

  • Classifies roads according to their purpose and function. The road-type classification can be used for efficient traffic flow management, avoidance of specific routes based on selected criteria, and visual differentiation of road segments on the map.

    See more

    Declaration

    Swift

    public enum RoadType

SpeedLimit

  • Speed limit consisting of a speed limit type and a speed limit value.

    See more

    Declaration

    Swift

    public enum SpeedLimit : Equatable

Category

  • Indicates the category to which a traffic event belongs.

    Important

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

    Declaration

    Swift

    public enum Category

Cause

  • Indicates the cause of a traffic event.

    Important

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

    Declaration

    Swift

    public struct Cause

CauseCode

  • Indicates the cause of the traffic event. Codes are chosen according to the TPEG-TEC standard.

    Important

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

    Declaration

    Swift

    public enum CauseCode

EffectCode

  • Important

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

    Declaration

    Swift

    public enum EffectCode

TrafficEvent

  • Representation of a traffic event. Traffic events represent unusual situations on the road, like traffic congestion, accidents or road works.

    Important

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

    Declaration

    Swift

    public struct TrafficEvent

WarningLevel

  • Indicates the severity of the traffic event. Values are chosen according to the TPEG-TEC standard.

    Important

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

    Declaration

    Swift

    public enum WarningLevel

Cancellable

  • Represents a cancellation handler over an asynchronous operation. Cancellation may be immediate or simply requested to happen sometime in the future.

    A typical usage for Cancellable is to return it from the asynchronous completion-based API.

    let cancellable = asynchronousFunction(completion: completion)
    if shouldCancel {
       cancellable.cancel()
    }
    

    Note

    Cancellable implementation must support thread-safety and guarantee that after calling cancel() the cancellation happens only once.
    See more

    Declaration

    Swift

    public protocol Cancellable

EquatableWrapper

  • Wrapper to provide equatable conformance to Apple objects inside of the SDK.

    See more

    Declaration

    Swift

    @propertyWrapper
    public struct EquatableWrapper<T> : Equatable

ADRTunnelRestrictionCode

  • Specifies if the vehicle should be subjected to ADR tunnel restrictions.

    Important

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

    Declaration

    Swift

    public enum ADRTunnelRestrictionCode

AltitudeChangeEfficiency

  • Specifies the ratio by which energy is converted for altitude changes.

    Important

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

    Declaration

    Swift

    public struct AltitudeChangeEfficiency : Equatable, Hashable

AltitudeChangeEnergy

  • Specifies the energy that is gained or lost by altitude changes.

    Important

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

    Declaration

    Swift

    public struct AltitudeChangeEnergy : Equatable, Hashable

ChargingConnector

  • Describes connector information of an electric engine.

    Important

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

    Declaration

    Swift

    public struct ChargingConnector : Equatable, Hashable
  • Specifies the efficiency of the vehicle. Refer to the original type CombustionEngine.Efficiency for more information.

    Important

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

    Declaration

    Swift

    public typealias CombustionVehicleEfficiency = CombustionEngine.Efficiency
  • Describes parameters used to determine the vehicle power and consumption. Refer to the original type CombustionEngine.Consumption for more information.

    Important

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

    Declaration

    Swift

    public typealias CombustionVehicleConsumption = CombustionEngine.Consumption

CombustionEngine

  • A combustion vehicle engine for route planning and consumption estimation.

    Important

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

    Declaration

    Swift

    public struct CombustionEngine
  • Specifies the efficiency of the vehicle. Refer to the original type ElectricEngine.Efficiency for more information.

    Important

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

    Declaration

    Swift

    public typealias ElectricVehicleEfficiency = ElectricEngine.Efficiency
  • Describes capacity and the consumption of the EV. Refer to the original type ElectricEngine.Consumption for more information.

    Important

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

    Declaration

    Swift

    public typealias ElectricVehicleConsumption = ElectricEngine.Consumption
  • Describes capacity and current charge of the EV. Refer to the original type ElectricEngine.ChargeLevel for more information.

    Important

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

    Declaration

    Swift

    public typealias ChargeLevel = ElectricEngine.ChargeLevel
  • Describes connector information of an electric engine. Refer to the original type ElectricEngine.ChargingParameters for more information.

    Important

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

    Declaration

    Swift

    public typealias ChargingParameters = ElectricEngine.ChargingParameters

ElectricEngine

  • A electric vehicle engine for route planning and consumption estimation.

    Important

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

    Declaration

    Swift

    public struct ElectricEngine

EngineType

  • Represents the types of the vehicle engine (e.g., electric).

    Important

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

    Declaration

    Swift

    public enum EngineType

Motorized

  • Trait interface for vehicles that may have electric and/or combustion engines. These vehicles may also be subject to restrictions based on their size or weight.

    Both engines should be set for a hybrid vehicle. Setting no engine is also fine if consumption is irrelevant for a calculation, such as when requesting a range based on time or distance budgets.

    Important

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

    Declaration

    Swift

    public protocol Motorized

CargoCapable

  • Trait interface for vehicles that may have restrictions due to load.

    Important

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

    Declaration

    Swift

    public protocol CargoCapable

Vehicle

  • Specifies the vehicle (or lack of one).

    Important

    You cannot declare new conformances. Only TomTomSDKCommon/Pedestrian, TomTomSDKCommon/Bicycle, TomTomSDKCommon/Car, TomTomSDKCommon/Motorcycle, TomTomSDKCommon/Van, TomTomSDKCommon/Taxi, TomTomSDKCommon/Bus and TomTomSDKCommon/Truck are valid conforming types.

    Important

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

    Declaration

    Swift

    public protocol Vehicle : ConformanceLocked

Pedestrian

  • A pedestrian.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Pedestrian : Vehicle, InternalConformanceLocked

Bicycle

  • A vehicle of type bicycle.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Bicycle : Vehicle, InternalConformanceLocked

Car

  • Car

    A vehicle of type car.

    Important

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

    Declaration

    Swift

    public struct Car : Vehicle, Motorized, InternalConformanceLocked

Motorcycle

  • A vehicle of type motorcycle.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Motorcycle : Vehicle, Motorized, InternalConformanceLocked

Van

  • Van

    A vehicle of type van.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Van : Vehicle, Motorized, CargoCapable, InternalConformanceLocked

Taxi

  • A vehicle of type taxi.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Taxi : Vehicle, Motorized, InternalConformanceLocked

Bus

  • Bus

    A vehicle of type bus.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Bus : Vehicle, Motorized, InternalConformanceLocked

Truck

  • A vehicle of type truck.

    Note

    This option is not yet supported with the Orbis map.

    Important

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

    Declaration

    Swift

    public struct Truck : Vehicle, Motorized, CargoCapable, InternalConformanceLocked

VehicleDimensions

  • Describes dimensions of the vehicle.

    Important

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

    Declaration

    Swift

    public struct VehicleDimensions
  • VehicleError used for exceptions indicating vehicle errors.

    Important

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

    Declaration

    Swift

    public enum VehicleError : Error, Equatable

VehicleGeneralLoadType

  • Types of cargo that may be classified as hazardous materials and restricted from some roads (European notation).

    Important

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

    Declaration

    Swift

    public enum VehicleGeneralLoadType

VehicleDangerousLoadType

  • Types of cargo that may be classified as hazardous materials and restricted from some roads (American notation).

    Important

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

    Declaration

    Swift

    public enum VehicleDangerousLoadType

VehicleLoadType

  • Represents types of cargo that may be classified as hazardous materials and restricted from some roads. Available values are UN Hazmat classes 1 through 9, plus generic classifications for use in other countries.

    Important

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

    Declaration

    Swift

    public enum VehicleLoadType

VehicleModelID

  • Describes vehicle model identifier.

    Important

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

    Declaration

    Swift

    public struct VehicleModelID : Equatable

VehicleType

  • Represents the “vehicle type” parameter in a request to the Routing API.

    See more

    Declaration

    Swift

    public enum VehicleType

VelocityChangeEfficiency

  • Specifies the ratio by which energy is converted during velocity changes.

    Important

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

    Declaration

    Swift

    public struct VelocityChangeEfficiency : Equatable, Hashable

Codable