EAAccessoryDidConnect
A notification that the system sends when an accessory becomes connected and available for your application to use.
Declaration
static let EAAccessoryDidConnect: NSNotification.NameDiscussion
The notification object is the shared accessory manager. The userInfo dictionary contains an EAAccessoryKey, whose value is an EAAccessory object representing the accessory that is now connected. If a Bluetooth accessory was selected by the user in the Bluetooth picker, this dictionary contains the EAAccessorySelectedKey key. Before delivery of this notification can occur, you must call the registerForLocalNotifications() method to let the system know you are interested in receiving this notification.
After receiving this notification, always check the protocolStrings array of the newly connected accessory object to verify that the required protocol is present before trying to open a session. In some cases, the system may send the connection notification before authentication has completed, resulting in an empty protocolStrings array and a subsequent disconnection message. If this happens, the system sends another connection message later, when authentication succeeds.