<!--
{
  "availability" : [
    "iOS: 7.0.0 - 27.0.0",
    "iPadOS: 7.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.10.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "MultipeerConnectivity",
  "identifier" : "/documentation/MultipeerConnectivity/MCSession/encryptionPreference",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Multipeer Connectivity"
    ],
    "preciseIdentifier" : "c:objc(cs)MCSession(py)encryptionPreference"
  },
  "title" : "encryptionPreference"
}
-->

# encryptionPreference

A value indicating whether the connection prefers encrypted connections, unencrypted connections, or has no preference.

```
var encryptionPreference: MCEncryptionPreference { get }
```

## Discussion

You set this value when you initialize the session object. It cannot be changed later. For possible values, see [`MCEncryptionPreference`](/documentation/MultipeerConnectivity/MCEncryptionPreference)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)