Multipeer Connectivity in iOS

In this course, you'll learn how to use Multipeer Connectivity: Apple's framework for transferring data between devices with no external network. By Jessy Catterwaul.

4 (1) · 1 Review

Download materials
Save for later
Comments
Share

Who is this for?

If you need a way to communicate wirelessly with Apple devices in close proximity to each other, in a blazing fast way, and you're quite comfortable with Swift, this course is likely a good match for you. SwiftUI and Combine knowledge will be helpful: they're both used in this course, but are not essential for employing Multipeer Connectivity.

Covered concepts

  • Local Networking
  • MCSession
  • MCNearbyServiceAdvertiser
  • MCBrowserViewController
  • Combine
01
Toggle description

The first step to adding Multipeer Connectivity to any app is to ask for permission and tell users why it will use a local network. You'll use Info.plist for this.

Toggle description

In order to advertise your device to others, you'll need to use a reference to a Multipeer Connectivity Session object.

Toggle description

Once your device is advertising that it’s available, you'll need to employ MCNearbyServiceAdvertiserDelegate to handle requests to connect to other devices.

Discovery 3:19
Toggle description

When you have devices advertised through Multipeer Connectivity, the next step is to discover them. For that, you can use an MCNearbyServiceBrowser object.

Send Data 4:11
Toggle description

With an MCSession on one device, you can send data. And on another, an MCSessionDelegate will receive it.

Toggle description

Multipeer Connectivity provides a standard UI that abstracts what can be achieved with MCNearbyServiceBrowser: MCBrowserViewController.