TTRoute

Objective-C

@interface TTRoute : TTRequestScheduler

Swift

class TTRoute : TTRequestScheduler

TomTom Route API main object. Contains methods to use TomTom’s online route engine and provides support for both async and sync calls.

  • Deprecated

    since 15.06.2020 - This method is deprecated. Use the ‘initWithKey’ method to init with Key.

    Initializer with info.plist Key.

    Declaration

    Objective-C

    - (instancetype _Nonnull)init;

    Swift

    init()
  • Initializer with key for TomTom API Service.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithKey:(NSString *_Nonnull)key;

    Swift

    init(key: String)
  • Register delegate to receive callbacks with result or error response.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<TTRouteResponseDelegate> _Nullable delegate;

    Swift

    weak var delegate: TTRouteResponseDelegate? { get set }
  • Route with async block

    Declaration

    Objective-C

    - (void)planRouteWithQuery:(TTRouteQuery *_Nonnull)query
             completionHandler:
                 (void (^_Nonnull)(TTRouteResult *_Nullable,
                                   TTResponseError *_Nullable))completionHandler;

    Swift

    func plan(with query: TTRouteQuery, completionHandler: @escaping (TTRouteResult?, TTResponseError?) -> Void)

    Parameters

    query

    Object containing the data needed to perform a route query.

    completionHandler

    CompletionHandler that informs the subscriber when a route result is available. It contains a TTRouteResult object.

  • Route with async callback

    Declaration

    Objective-C

    - (void)planRouteWithQuery:(TTRouteQuery *_Nonnull)query;

    Swift

    func plan(with query: TTRouteQuery)

    Parameters

    query

    Object containing the data needed to perform a route query.