---
title: "finishPickerDiscovery(completionHandler:)"
framework: accessorysetupkit
role: symbol
role_heading: Instance Method
path: "accessorysetupkit/asaccessorysession/finishpickerdiscovery(completionhandler:)"
---

# finishPickerDiscovery(completionHandler:)

Finish the discovery session in the picker and show a timeout error.

## Declaration

```swift
func finishPickerDiscovery(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func finishPickerDiscovery() async throws
```

## Parameters

- `completionHandler`: A block or closure that executes after this operation completes. The completion handler receives an doc://com.apple.documentation/documentation/Foundation/NSError instance if the operation encounters an error.

## Mentioned in

Discovering and configuring accessories

## Discussion

Discussion Use this method if you previously set the picker display setting discoveryTimeout to unbounded in order to perform manual filtering of discovered accessories. Calling this method finishes the discovery session in the picker and shows a timeout error if the session didn’t find any desired accessories. Calling this method after updating the picker with discovered accessories has no effect.
