<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVRouting",
  "identifier" : "/documentation/AVRouting/AVCustomRoutingController/setActive(_:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVRouting"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCustomRoutingController(im)setActive:forRoute:"
  },
  "title" : "setActive(_:for:)"
}
-->

# setActive(_:for:)

Sets the active state of a route.

```
func setActive(_ active: Bool, for route: AVCustomDeviceRoute)
```

## Parameters

`active`

A Boolean value that indicates whether the route is active.

`route`

A route to change the active state for.

## Discussion

Set the value to <doc://com.apple.documentation/documentation/Swift/false> if the connection to the route becomes unavailable, and set it to <doc://com.apple.documentation/documentation/Swift/true> after you reestablish the connection.

---

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)