showPicker(completionHandler:)
Present a picker that shows accessories managed by a Device Discovery Extension in your app.
Declaration
func showPicker(completionHandler: @escaping @Sendable ((any Error)?) -> Void)func showPicker() async throwsParameters
- 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.
Discussion
Use this method when your app includes a DeviceDiscoveryExtension for its supported accessories. If your app doesn’t use DDE, call showPicker(for:completionHandler:) with an array of ASPickerDisplayItem instances instead.
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.