MultipeerConnectivity discovers nearby peers and exchanges data over Wi-Fi, peer-to-peer Wi-Fi, and Bluetooth, without requiring an internet connection. You advertise your device with MCNearbyServiceAdvertiser and find others with MCNearbyServiceBrowser, identify each participant by an MCPeerID, and connect them through an MCSession whose MCSessionDelegate reports state changes via MCSessionState and delivers received data. For interactions that need a built-in interface, MCAdvertiserAssistant and MCBrowserViewController present standard discovery and invitation flows, while MCEncryptionPreference and MCSessionSendDataMode let you control how connections are secured and how data is sent.
Essentials 3
The core objects that identify peers and establish a connected multipeer session.
- ClMCPeerIDAn object that uniquely identifies a peer device in a multipeer session by a display name.
- ClMCSessionAn object that manages connections among nearby peers and exchanges data, streams, and resources between them.
- PrMCSessionDelegateA protocol that handles peer state changes and the receipt of data, streams, and resources in a session.
Advertising a Service 2
Types that publish your device so nearby peers can discover and invite it.
- ClMCNearbyServiceAdvertiserAn object that advertises a device's availability for a named service so nearby browsers can discover it.
- PrMCNearbyServiceAdvertiserDelegateA protocol that handles invitations received by an advertiser and reports advertising errors.
Browsing for Peers 2
Types that find nearby advertised peers and send connection invitations.
- ClMCNearbyServiceBrowserAn object that searches for nearby advertised peers and sends them invitations to join a session.
- PrMCNearbyServiceBrowserDelegateA protocol that reports discovered and lost peers and browsing errors to a browser.
Built-in Discovery Interfaces 4
Standard system UI for advertising and for browsing and inviting peers.
- ClMCAdvertiserAssistantAn object that advertises a service and presents a standard interface for handling invitations from nearby peers.
- PrMCAdvertiserAssistantDelegateA protocol that responds to the presentation and dismissal of an advertiser assistant's invitation interface.
- ClMCBrowserViewControllerA view controller that presents a standard interface for browsing nearby peers and inviting them to a session.
- PrMCBrowserViewControllerDelegateA protocol that responds to the user finishing or canceling browsing in a browser view controller.
Connection and Transport Options 3
Enumerations that control session encryption, connection state, and how data is delivered.
- EnMCSessionStateConstants that indicate the current connection state of a peer in a session.
- EnMCEncryptionPreferenceConstants that specify whether a session requires, prefers, or disables encryption for peer connections.
- EnMCSessionSendDataModeConstants that specify whether session data is sent reliably or as best-effort unreliable delivery.
Errors 1
The error type reported by MultipeerConnectivity operations.
- StMCErrorA structure that describes errors reported by MultipeerConnectivity operations.