ASAccessorySession
A class to coordinate accessory discovery.
Declaration
class ASAccessorySessionMentioned in
Overview
Use an instance of ASAccessorySession to interact with the AccessorySetupKit framework.
Start the session by calling activate(on:eventHandler:), and pass in a dispatch queue and an event-handling closure. AccessorySetupKit calls back to your event handler as the discovery session processes events.
With your event-handler prepared, create an array of ASPickerDisplayItem instances to describe accessories your app can set up. Pass this array to the session’s showPicker(for:completionHandler:) method to allow someone using your app to choose a discovered accessory to set up. Your event handler receives events as the picker appears and dismisses, as well as when the person using the app adds an accessory.
Topics
Managing the session life cycle
Displaying an accessory picker
Customizing picker behavior
Updating the picker
Ending filtered discovery
Accessing discovered accessories
Managing accessories
renameAccessory(_:options:completionHandler:)ASAccessory.RenameOptionsremoveAccessory(_:completionHandler:)