<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceRoutingManager/routingManager(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB14RoutingManagerC07routingD03forAcA0aB9Extension_p_tFZ"
  },
  "title" : "routingManager(for:)"
}
-->

# routingManager(for:)

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

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

## Parameters

`extension`

The extension to obtain the routing manager for.

## Return Value

The shared [`MediaDeviceRoutingManager`](/documentation/MediaDevice/MediaDeviceRoutingManager) instance.

## Discussion

Use this method to obtain the shared [`MediaDeviceRoutingManager`](/documentation/MediaDevice/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 ``doc://com.apple.mediadevice/documentation/MediaDevice/MediaDeviceRoutingManager`` instance.

---

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)