Sorry, you need to enable JavaScript to visit this website.

Documentation

Documentation

Initialization

TTL2Search class encapsulates a connection bridge to TomTom Search API service.

_

let search = TTSearch()
self.search = [TTSearch new];

 

Call the searchWithQuery method to perform a search. The call uses the TTL2SearchQuery parameter from the TTL2Search class.
Use the builder design pattern to simplify construction of the TTL2SearchQuery.

The API reference contains a detailed specification of the search objects and options.
It also includes a number of functional examples to illustrate different uses cases.

Search result delegate

Every search request requires a TTL2SearchDelegate object. The object calls one of two methods asynchronously when the search result is ready:

  1. If the search query is successful, the first method returns an array of search results.

  2. If the query fails, the second method returns an error code and an error message.

_

func search(_: TTSearch, completedWith response: TTSearchResponse) {
    progress.hide()
    displayResults(response.results)
}
func search(_: TTSearch, failedWithError error: TTResponseError) {
    handleError(error)
}
- (void)search:(TTSearch *)search completedWithResponse:(TTSearchResponse *)response {
    [self.progress hide];
    [self displayResults:response.results];
}
- (void)search:(TTSearch *)search failedWithError:(TTResponseError *)error {
    [self handleError:error];
}

 

You are here