---
title: "routingManager(for:)"
framework: mediadevice
role: symbol
role_heading: Type Method
path: "mediadevice/mediadeviceroutingmanager/routingmanager(for:)"
---

# routingManager(for:)

Returns the shared routing manager instance for a media device extension.

## Declaration

```swift
@MainActor static func routingManager(for extension: any MediaDeviceExtension) -> MediaDeviceRoutingManager
```

## Parameters

- `extension`: The extension to obtain the routing manager for.

## Mentioned in

Creating a media device extension

## Return Value

Return Value The shared MediaDeviceRoutingManager instance.

## Discussion

Discussion Use this method to obtain the shared MediaDeviceRoutingManager instance for your extension. The routing manager is how your extension reports device discovery, state changes, and playback events to the system. note: The routing manager is a shared instance. Calling this method multiple times for a given extension returns the same MediaDeviceRoutingManager instance.
