Conforms to NSObject
Declared in STAPIClient.h

Overview

Used by STAPIClient to keep delegate informed of the status of the query.

Tasks

Instance Methods

client:didCancelQuery:withType:

The query was canceled with an explicit call to the STAPIClient method cancelQuery or as a result of the client starting a new query.

- (void)client:(STAPIClient *)client didCancelQuery:(NSString *)query withType:(STSearchType)type

Parameters

client

Instance of STAPIClient making the request

query

The query string entered by the user

type

The type of search to be performed. Either a search or a suggest

Discussion

The query was canceled with an explicit call to the STAPIClient method cancelQuery or as a result of the client starting a new query.

Declared In

STAPIClient.h

client:didFailQuery:withType:error:

The client failed to retrieve a result from the server. This can happen as a result of a timeout, server error, lack of internet or many other reasons. The exact cause of the failure will be in the error parameter.

- (void)client:(STAPIClient *)client didFailQuery:(NSString *)query withType:(STSearchType)type error:(NSError *)error

Parameters

client

Instance of STAPIClient making the request

query

The query string entered by the user

type

The type of search to be performed. Either a search or a suggest

error

Stores more detailed information about the cause of the failure.

Discussion

The client failed to retrieve a result from the server. This can happen as a result of a timeout, server error, lack of internet or many other reasons. The exact cause of the failure will be in the error parameter.

Declared In

STAPIClient.h

client:didFinishQuery:withResult:withType:

The client succesfully received the results of query from the server

- (void)client:(STAPIClient *)client didFinishQuery:(NSString *)query withResult:(NSDictionary *)result withType:(STSearchType)type

Parameters

client

Instance of STAPIClient making the request

query

The query string entered by the user

result

The NSDictionary representation of the search results

type

The type of search to be performed. Either a search or a suggest

Discussion

The client succesfully received the results of query from the server

Declared In

STAPIClient.h

client:didStartQuery:withType:

The client started a query with the server. The result of the query will be indicated with a call to one of the following methods on the delegate: finish, cancel or failure.

- (void)client:(STAPIClient *)client didStartQuery:(NSString *)query withType:(STSearchType)type

Parameters

client

Instance of STAPIClient making the request

query

The query string entered by the user

type

The type of search to be performed. Either a search or a suggest.

Discussion

The client started a query with the server. The result of the query will be indicated with a call to one of the following methods on the delegate: finish, cancel or failure.

Declared In

STAPIClient.h

clientRequestParameters:forQuery:withType:

Required delegate method that should return the search parameters that will be posted to the server. The possible search parameters can be found here http://swiftype.com/documentation/searching

- (NSDictionary *)clientRequestParameters:(STAPIClient *)client forQuery:(NSString *)query withType:(STSearchType)type

Parameters

client

Instance of STAPIClient making the request

query

The query string entered by the user

type

The type of search to be performed. Either a search or a suggest.

Return Value

dictionary of search parameters that will be JSON encoded and posted to the server

Discussion

Required delegate method that should return the search parameters that will be posted to the server. The possible search parameters can be found here http://swiftype.com/documentation/searching

Declared In

STAPIClient.h