iOS Developer Library

Developer

EAAccessoryDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

EAAccessoryDelegate

The EAAccessoryDelegate protocol defines a single method for receiving notifications when the associated EAAccessory object is disconnected. Implementation of this method is optional.

Inheritance


Not Applicable

Import Statement


Swift

import ExternalAccessory

Objective-C

@import ExternalAccessory;

Availability


Available in iOS 3.0 and later.
  • Tells the delegate that the specified accessory was disconnected from the device.

    Declaration

    Swift

    optional func accessoryDidDisconnect(_ accessory: EAAccessory!)

    Objective-C

    - (void)accessoryDidDisconnect:(EAAccessory *)accessory

    Parameters

    accessory

    The accessory that was disconnected.

    Discussion

    The accessory manager calls this method as a convenience whenever it receives an EAAccessoryDidDisconnectNotification notification. You can use this method to remove any references to the specified accessory object and to stop any services currently using the accessory.

    Because this is a convenience method, your delegate does not also need to register as an observer of the EAAccessoryDidDisconnectNotification notification. However, if you want your delegate to be notified of newly connected accessories, you should configure it as an observer of the EAAccessoryDidConnectNotification notification.

    Import Statement

    Objective-C

    @import ExternalAccessory;

    Swift

    import ExternalAccessory

    Availability

    Available in iOS 3.0 and later.