---
title: onDemandRules
framework: networkextension
role: symbol
role_heading: Instance Property
path: networkextension/nevpnmanager/ondemandrules
---

# onDemandRules

An ordered list of Connect On Demand rules.

## Declaration

```swift
var onDemandRules: [NEOnDemandRule]? { get set }
```

## Discussion

Discussion The VPN configuration can optionally be configured to connect automatically based on a variety of criteria specified in NEOnDemandRule objects. The onDemandRules property contains the current set of Connect On Demand rules for the VPN configuration. Each rule is evaluated in order, and the first rule that matches all criteria on the current network is applied.

## See Also

### Accessing VPN configuration properties

- [isEnabled](networkextension/nevpnmanager/isenabled.md)
- [protocolConfiguration](networkextension/nevpnmanager/protocolconfiguration.md)
- [protocol](networkextension/nevpnmanager/protocol.md)
- [localizedDescription](networkextension/nevpnmanager/localizeddescription.md)
- [isOnDemandEnabled](networkextension/nevpnmanager/isondemandenabled.md)
