---
title: "handle(intent:completion:)"
framework: intents
role: symbol
role_heading: Instance Method
path: "intents/insearchforphotosintenthandling/handle(intent:completion:)"
---

# handle(intent:completion:)

Handles searching the photos and returning the number of results.

## Declaration

```swift
func handle(intent: INSearchForPhotosIntent, completion: @escaping @Sendable (INSearchForPhotosIntentResponse) -> Void)
```

```swift
func handle(intent: INSearchForPhotosIntent) async -> INSearchForPhotosIntentResponse
```

## Parameters

- `intent`: The intent object containing details about the user’s request. Your handler object has already resolved and confirmed the information in this object.
- `completion`: The handler block to execute with your response. You must execute this handler at some point during your implementation of this method. This handler has no return value and takes the following parameter:

## Discussion

Discussion Your implementation of this method must perform the search and return the number of matching photos in the response. If you aren’t to perform the search, return a response object whose result code indicates the reason for the failure. Upon returning a successful response, Siri launches your display the photos.
