Indicates whether a session should use encryption when communicating with nearby peers.


enum MCEncryptionPreference : Int



case optional

The session prefers to use encryption, but accepts unencrypted connections. A connection uses encryption when all the peers choose either MCEncryptionPreference.optional or MCEncryptionPreference.required. If some peers choose MCEncryptionPreference.none, then the session will not be encrypted. For this reason, if some peers running your app can be configured without encryption, you should always assume that the session is unencrypted.

case required

The session requires encryption.

case none

The session should not be encrypted.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software