Protocols

The following protocols are available globally.

  • 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

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

Observer

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

    Declaration

    Swift

    public protocol Observer : AnyObject

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.

    Important

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

    Declaration

    Swift

    public protocol Cancellable

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

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

    Declaration

    Swift

    public protocol Vehicle