---
title: "setPrivacyContext(_:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/nwparameters/setprivacycontext(_:)"
---

# setPrivacyContext(_:)

Associates a privacy context with any connections or listeners that use the parameters.

## Declaration

```swift
final func setPrivacyContext(_ privacyContext: NWParameters.PrivacyContext)
```

## Discussion

Discussion The privacy context allows using separate caches for different sets of connections, as well as restricting how connection-specific information is logged and shared on the network.

## See Also

### Configuring Privacy Settings

- [NWParameters.PrivacyContext](network/nwparameters/privacycontext.md)
