---
title: "handle(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/portdelegate/handle(_:)"
---

# handle(_:)

Processes a given incoming message on the port.

## Declaration

```swift
optional func handle(_ message: NSPortMessage)
```

```swift
optional func handle(_ message: PortMessage)
```

## Parameters

- `message`: An incoming port message.

## Discussion

Discussion See Port for more information. The delegate should implement either handle(_:) or the NSMachPortDelegate protocol method handleMachMessage(_:). You must not implement both delegate methods.

## See Also

### Related Documentation

- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)
