showPicker(for:completionHandler:)
Present a picker that shows discovered accessories matching an array of display items.
Declaration
func showPicker(for displayItems: [ASPickerDisplayItem], completionHandler: @escaping @Sendable ((any Error)?) -> Void)func showPicker(for displayItems: [ASPickerDisplayItem]) async throwsParameters
- displayItems:
An array of 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 Nserror instance if the picker encounters an error.
Mentioned in
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.