<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ExternalAccessory",
  "identifier" : "/documentation/ExternalAccessory/EASession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "External Accessory"
    ],
    "preciseIdentifier" : "c:objc(cs)EASession"
  },
  "title" : "EASession"
}
-->

# EASession

The object you use to manage communications between your app and a connected hardware accessory.

```
class EASession
```

## Overview

An [`EASession`](/documentation/ExternalAccessory/EASession) object creates a communications channel between your app and a connected hardware accessory. The manufacturer of the device must share the accessory’s supported protocols with you. When you create your session, specify one of these protocols to initiate communication with the accessory. After initializing an [`EASession`](/documentation/ExternalAccessory/EASession) object, use the provided output and input streams to transfer data to and from the accessory using that protocol.

After creating a session object, immediately retrieve and configure the stream objects provided by the session. Streams send events to their associated delegate to notify it of changes in the stream status. For example, streams notify the delegate when data is waiting to be read or when more space is available for writing data. For more information about how to use stream objects, see [Stream Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Streams/Streams.html#//apple_ref/doc/uid/10000188i).

When sending and receiving data using the provided streams, it is your responsibility to ensure the data is formatted according to the specified protocol. The [`EASession`](/documentation/ExternalAccessory/EASession) class has no knowledge of specific accessory protocols and doesn’t attempt to format the data in any way before or after transferring it.

## Topics

### Creating the Session Object

[`-  initWithAccessory:forProtocol:`](/documentation/ExternalAccessory/EASession/init(accessory:forProtocol:))

Initializes the session for the specified accessory and protocol.

### Getting Session Information

[`accessory`](/documentation/ExternalAccessory/EASession/accessory)

The accessory attached to the session.

[`protocolString`](/documentation/ExternalAccessory/EASession/protocolString)

The protocol being used for communication with the accessory.

### Getting the Communication Streams

[`inputStream`](/documentation/ExternalAccessory/EASession/inputStream)

The stream to use for receiving data from the accessory.

[`outputStream`](/documentation/ExternalAccessory/EASession/outputStream)

The stream to use for sending data to the accessory.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)