Protocols
The following protocols are available globally.
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol Event
-
Common protocol for every geometry type.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol GeoJSON
-
The
MapDisplayDataProvider
protocol that can be used to add custom tile data providers.FileOutput
- Default logger output - prints logs usingSwift.print
Important
This API is for internal use only. It may be changed or removed at any time without prior notice.Declaration
Swift
public protocol MapDisplayDataProvider
-
A cancellable task of a data provider which gathers the resource.
See moreDeclaration
Swift
public protocol MapDisplayDataRequestToken
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol MapID
-
Important
This is a Public Preview API. It may be changed or removed at any time.Note
Do not implement this protocol. Use the TomTomSDK concrete class that implements this protocol.Declaration
Swift
public protocol MapPosition
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol MapReferences
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol RegionID
-
Map tile provider interface for map display.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol MapTileDataProviding : AnyObject
-
QueryItemConvertible allows
Any
become aURLQueryItem
Example:
“``extension String: QueryItemConvertible { public func queryItem(key: String) -> URLQueryItem? { .init(name: key, value: self) } }
- Important: This is a Public Preview API. It may be changed or removed at any time.
Declaration
Swift
public protocol QueryItemConvertible
-
QueryItemConvertible allows
Any
become an array ofURLQueryItem
sExample that allows an array of
SectionType
s become an array ofURLQueryItem
sextension SectionType: QueryItemConvertible { public func queryItem(key: String) -> URLQueryItem? { guard let value = value else { return nil } return .init(name: key, value: value) } } extension Array: QueryItemArrayConvertable where Element == SectionType { public func queryItems(key: String) -> [URLQueryItem]? { guard count > 0 else { return nil } return compactMap { $0.value }.map { URLQueryItem(name: key, value: $0) } } }
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol QueryItemArrayConvertable
-
Important
This API is for internal use only. It may be changed or removed at any time without prior notice.Declaration
Swift
public protocol Dispatching
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol DistanceRangeFormatter
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol Observer : AnyObject
-
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol Observable
-
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.Declaration
Swift
public protocol Motorized
-
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.Declaration
Swift
public protocol CargoCapable