registerForLocalNotifications()
Begins the delivery of accessory-related notifications to the current application.
Declaration
func registerForLocalNotifications()Discussion
Call this method to be notified when an accessory becomes connected or disconnected. The system does not send EAAccessoryDidConnectNotification and EAAccessoryDidDisconnectNotification notifications automatically, so calling this method lets the system know that your application wants to receive them. Typically, you would call this method only once early in your application, either before or after configuring your notification observers. When you no longer need to monitor these notifications, you should call the matching unregisterForLocalNotifications() method.
You can configure your notification observers either before or after calling this method. Because the shared accessory manager is the only object that sends accessory-related notifications, specifying that object or nil for the notification sender has the same outcome.