---
title: NEEvaluateConnectionRuleAction.connectIfNeeded
framework: networkextension
role: symbol
role_heading: Case
path: networkextension/neevaluateconnectionruleaction/connectifneeded
---

# NEEvaluateConnectionRuleAction.connectIfNeeded

Start the VPN if connections to the matching hostname cannot be resolved.

## Declaration

```swift
case connectIfNeeded
```

## See Also

### Rule Actions

- [NEEvaluateConnectionRuleAction.neverConnect](networkextension/neevaluateconnectionruleaction/neverconnect.md)
