---
title: "showPicker(for:completionHandler:)"
framework: accessorysetupkit
role: symbol
role_heading: Instance Method
path: "accessorysetupkit/asaccessorysession/showpicker(for:completionhandler:)"
---

# showPicker(for:completionHandler:)

Present a picker that shows discovered accessories matching an array of display items.

## Declaration

```swift
func showPicker(for displayItems: [ASPickerDisplayItem], completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

```swift
func showPicker(for displayItems: [ASPickerDisplayItem]) async throws
```

## Parameters

- `displayItems`: An array of doc://com.apple.AccessorySetupKit/documentation/AccessorySetupKit/ASPickerDisplayItem instances describing accessories your app can set up. The picker displays only discovered accessories that match the properties of items in this array.
- `completionHandler`: A block or closure that the picker calls when it completes the operation. The completion handler receives an doc://com.apple.documentation/documentation/Foundation/NSError instance if the picker encounters an error.

## Mentioned in

Discovering and configuring accessories

## Discussion

Discussion The session’s event handler receives events when this picker displays and dismisses, as well as when the person using the app picks an accessory. To migrate previously-configured accessories to AccessorySetupKit, add instances of ASMigrationDisplayItem to the displayItems array.

## See Also

### Displaying an accessory picker

- [showPicker(completionHandler:)](accessorysetupkit/asaccessorysession/showpicker(completionhandler:).md)
