TTSearch

@interface TTSearch : NSObject

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

  • Delegate that informs the subscriber when a search result is available. It contains a TTSearchResponse object.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) id<TTSearchDelegate> _Nullable delegate;

    Swift

    weak var delegate: TTSearchDelegate? { get set }
  • Search with async callback

    Declaration

    Objective-C

    - (void)searchWithQuery:(TTSearchQuery *_Nonnull)query
          withAsyncDelegate:(id<TTSearchDelegate> _Nonnull)delegate;

    Swift

    func search(with query: TTSearchQuery, withAsyncDelegate delegate: TTSearchDelegate)

    Parameters

    query

    Object containing the data needed to perform a search.

    delegate

    Delegate that informs the subscriber when a search result is available. It contains a TTSearchResult object or error if fails.

  • Search with async callback

    Declaration

    Objective-C

    - (void)searchWithQuery:(TTSearchQuery *_Nonnull)query;

    Swift

    func search(with query: TTSearchQuery)

    Parameters

    query

    Object containing the data needed to perform a search.

  • Search with async block

    Declaration

    Objective-C

    - (void)searchWithQuery:(TTSearchQuery *_Nonnull)query
          completionHandler:
              (void (^_Nonnull)(NSArray<TTSearchResult *> *_Nullable,
                                TTResponseError *_Nullable))completionHandler;

    Swift

    func search(with query: TTSearchQuery, completionHandler: @escaping ([TTSearchResult]?, TTResponseError?) -> Void)

    Parameters

    query

    Object containing the data needed to perform a search.

    completionHandler

    CompletionHandler that informs the subscriber when a search result is available. It contains a TTSearchResult objects or error if fails. @deprecated This method is deprecated, use completionHandle with TTSearchResponse instead.

  • Search with async block

    Declaration

    Objective-C

    - (void)searchWithQuery:(TTSearchQuery *_Nonnull)query
           completionHandle:
               (void (^_Nonnull)(TTSearchResponse *_Nullable,
                                 TTResponseError *_Nullable))completionHandler;

    Swift

    func search(with query: TTSearchQuery, completionHandle completionHandler: @escaping (TTSearchResponse?, TTResponseError?) -> Void)

    Parameters

    query

    Object containing the data needed to perform a search.

    completionHandler

    CompletionHandler that informs the subscriber when a search response is available. It contains a TTSearchResponse object.

  • Cancels the current search request.

    Declaration

    Objective-C

    - (void)cancel;

    Swift

    func cancel()