Instance Method

handle(intent:completion:)

Performs the search and returns the results.

Required.

Declaration

func handle(intent: INSearchForMessagesIntent, completion: @escaping (INSearchForMessagesIntentResponse) -> Void)

Parameters

intent

The intent object that contains details about the user’s request. The object’s informatin has already been resolved and confirmed by your handler object.

completion

The handler block to execute with your response. You must execute this handler while implementing this method. This handler has no return value and takes the following parameter:

response

The INSearchForMessagesIntentResponse object that contains the status of the request. You also use this object to specify the messages that matched the search parameters. This parameter must not be nil.

Discussion

Your implementation of this method must perform the search and return the results as part of your response object. If you are unable to perform the search, return a response object whose result code indicates the reason for the failure.