<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/PortDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSPortDelegate"
  },
  "title" : "PortDelegate"
}
-->

# PortDelegate

An interface for handling incoming messages.

```
protocol PortDelegate : NSObjectProtocol
```

## Overview

The [`PortDelegate`](/documentation/Foundation/PortDelegate) protocol defines the optional methods implemented by delegates of [`Port`](/documentation/Foundation/Port) objects.

## Topics

### Handling Port Messages

[`-  handlePortMessage:`](/documentation/Foundation/PortDelegate/handle(_:))

Processes a given incoming message on the port.

## Relationships

### Inherits From

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

### Inherited By

[`NSMachPortDelegate`](/documentation/Foundation/NSMachPortDelegate)

---

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)