---
title: "setActive(_:for:)"
framework: avrouting
role: symbol
role_heading: Instance Method
path: "avrouting/avcustomroutingcontroller/setactive(_:for:)"
---

# setActive(_:for:)

Sets the active state of a route.

## Declaration

```swift
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

Discussion Set the value to false if the connection to the route becomes unavailable, and set it to true after you reestablish the connection.

## See Also

### Activating a route

- [isRouteActive(_:)](avrouting/avcustomroutingcontroller/isrouteactive(_:).md)
