---
title: DDEventHandler
framework: DeviceDiscoveryExtension
role: symbol
role_heading: Type Alias
path: devicediscoveryextension/ddeventhandler
---

# DDEventHandler

A function that the extension invokes to signal an event.

## Declaration

```swift
typealias DDEventHandler = (DDDeviceEvent) -> Void
```

## Parameters

- `inEvent`: An event that the extension creates for the event handler.

## Discussion

Discussion A device discovery extension implements a closure of this format and calls it after creating argument events. In the implementation, the extension creates device events (DDEvent) and passes them to the system by calling report(_:). For an example event handler, see Appex.swift in Discovering a third-party media-streaming device.

## See Also

### Life cycle

- [DDDeviceEvent](devicediscoveryextension/dddeviceevent.md)
- [DDDeviceEvent.EventType](devicediscoveryextension/dddeviceevent/eventtype-swift.enum.md)
- [DDEventTypeToString(_:)](devicediscoveryextension/ddeventtypetostring(_:).md)
