<!--
{
  "availability" : [
    "iOS: 12.0.0 - 18.0.0",
    "iPadOS: 12.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.14.0 - 15.0.0",
    "visionOS: 1.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDICISession/init(discoveredNode:dataReadyHandler:disconnectHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:objc(cs)MIDICISession(im)initWithDiscoveredNode:dataReadyHandler:disconnectHandler:"
  },
  "title" : "init(discoveredNode:dataReadyHandler:disconnectHandler:)"
}
-->

# init(discoveredNode:dataReadyHandler:disconnectHandler:)

Creates a MIDI-CI session.

```
init(discoveredNode: MIDICIDiscoveredNode, dataReadyHandler handler: @escaping () -> Void, disconnectHandler: @escaping MIDICISessionDisconnectBlock)
```

## Parameters

`discoveredNode`

A node found during discovery.

`handler`

A block the system calls when the session’s data is ready.

`disconnectHandler`

A block the system calls when you disconnect from the session.

## Topics

### Handling Callbacks

[`MIDICISessionDisconnectBlock`](/documentation/CoreMIDI/MIDICISessionDisconnectBlock)

A block the system calls when a MIDI-CI session disconnects.



---

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)