Class

EAAccessoryManager

The object you use to identify connected accessories, and to begin the delivery of connection and disconnection notifications.

Declaration

class EAAccessoryManager : NSObject

Overview

An EAAccessoryManager object coordinates the attached accessories for an iOS-based device. Use an accessory manager to retrieve a list of accessories that you want your app to be able to connect to. You also use that object to start and stop the sending of accessory-related connect and disconnect notifications.

Topics

Getting the Shared Accessory Manager

class func shared() -> EAAccessoryManager

Returns the shared accessory manager object for the iOS-based device.

Starting and Stopping Accessory Notifications

func registerForLocalNotifications()

Begins the delivery of accessory-related notifications to the current application.

func unregisterForLocalNotifications()

Stops the delivery of accessory-related notifications to the current application.

Monitoring Connection Status Changes

static let EAAccessoryDidDisconnect: NSNotification.Name

A notification that is posted when an accessory is disconnected and no longer available for your application to use.

static let EAAccessoryDidConnect: NSNotification.Name

A notification that is posted when an accessory becomes connected and available for your application to use.

let EAAccessoryKey: String

A key that indicates the accessory object whose status changed.

let EAAccessorySelectedKey: String

A key that indicates the accessory object that the user selected.

Presenting the Bluetooth Picker

func showBluetoothAccessoryPicker(withNameFilter: NSPredicate?, completion: EABluetoothAccessoryPickerCompletion?)

Displays an alert that allows the user to pair the device with a Bluetooth accessory.

typealias EABluetoothAccessoryPickerCompletion

The completion block for the Bluetooth picker.

struct EABluetoothAccessoryPickerError

Error codes returned by the Bluetooth accessory picker.

enum EABluetoothAccessoryPickerError.Code

The error codes that may be passed in an error object for the Bluetooth picker completion block.

let EABluetoothAccessoryPickerErrorDomain: String

The domain for errors passed to a Bluetooth picker completion block.

Getting the Available Accessories

var connectedAccessories: [EAAccessory]

The accessory objects corresponding to the list of currently connected accessories.

Relationships

Inherits From

Conforms To

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software