TTAutocompleteDelegate

@protocol TTAutocompleteDelegate <NSObject>

@brief TTAutocomplete delegate.

  • Method that handles the search Response when a search returns a Response. Within this callback the user will obtain a Response populated with results.

    Declaration

    Objective-C

    - (void)request:(TTAutocomplete *_Nonnull)request
        completedWithResponse:(TTAutocompleteResponse *_Nonnull)result;

    Swift

    optional func request(_ request: TTAutocomplete, completedWith result: TTAutocompleteResponse)

    Parameters

    request

    Object type TTAutocomplete.

    result

    Object type TTAutocompleteResponse.

  • Method that handles the search Response when a search returns an error. Within this callback the user will obtain a Throwable fail reason.

    Declaration

    Objective-C

    - (void)request:(TTAutocomplete *_Nonnull)request
        failedWithError:(TTResponseError *_Nonnull)error;

    Swift

    optional func request(_ request: TTAutocomplete, failedWithError error: Any!)

    Parameters

    request

    Object type TTAutocompleteRequest.

    error

    Object type TTResponseError.