---
title: "setConnectionCodeSigningRequirement(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsxpclistener/setconnectioncodesigningrequirement(_:)"
---

# setConnectionCodeSigningRequirement(_:)

Sets the code signing requirement for connections to this listener.

## Declaration

```swift
func setConnectionCodeSigningRequirement(_ requirement: String)
```

## Parameters

- `requirement`: A string that describes requirements expected of the connection peer. See https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/ for more information on the code signing format.

## Discussion

Discussion Use this method to enforce a code-signing requirement on incoming XPC connections. The following example shows how a listener can ensure that the XPC client service on the other end of a connection has a specific entitlement.
