Library / SDK
insidegui/MultipeerKit avatar
insidegui/MultipeerKit

MultipeerKit is a Codable layer over Apple's peer to peer framework

MultipeerConnectivity + Codable = ❤️

1,132 stars79 forksSwiftBSD-2-Clause

At a glance

What is it?
MultipeerKit is a BSD licensed Swift package that wraps Apple's MultipeerConnectivity so that iOS, macOS and tvOS apps can exchange any Codable value over Wi-Fi, peer to peer Wi-Fi and Bluetooth, using one transceiver class for both sending and receiving. Its published release is from 2021, and the README is more useful than its version history.
Who is it for?
MultipeerKit suits an Apple platform developer who needs nearby devices to talk to each other without a server, and who is willing to work inside Apple's peer to peer framework and its local network permission model. It does not suit a project that needs peers across the internet, on Android, or on hardware outside the Apple ecosystem, because the framework it wraps is Apple only.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 116 days ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

It wraps a framework you would otherwise drive by hand

MultipeerKit is described as a high-level abstraction built on top of the MultipeerConnectivity framework, which allows iOS, macOS and tvOS devices to exchange data between them over Wi-Fi networks, peer-to-peer Wi-Fi and Bluetooth.

The value proposition is therefore a comparison with writing against MultipeerConnectivity directly. The framework gives you session management, discovery through Bonjour, a transport over the three links and a send and receive API, and the plumbing around a session, the invitation handshake, the peer bookkeeping and the encoding of what you actually want to say is yours to write. MultipeerKit supplies that layer and, more importantly, gives it a shape in which the payload is a Swift type rather than a resource or a byte buffer.

That is what the second line of the README says. MultipeerKit can transmit and receive anything that conforms to the Codable protocol, which makes it easy to define your own message types. A Codable struct is the unit of communication, so the type of a message is checked by the compiler on both sides of the connection.

For an Apple-only product where devices sit in the same room, this is a genuinely short path. A device to device chat, a local multiplayer game, a camera relay between an iPad and a Mac, a collaborative drawing surface: those are the projects this library makes short, and every one of them is local by definition.

One class handles sending and receiving

The API surface is a single class, MultipeerTransceiver, which does both the sending and receiving aspects of the multipeer communication. That is the design decision that makes the library small, and it is visible in the usage example.

A transceiver is created, started, given its message receivers, and then used to send:

swift
// Create a transceiver (make sure you store it somewhere, like a property)
let transceiver = MultipeerTransceiver()

// Start it up!
transceiver.resume()

// Configure message receivers
transceiver.receive(SomeCodableThing.self) { payload, sender in
    print("Got my thing from \(sender.name)! \(payload)")
}

// Broadcast message to peers
let payload = SomeEncodableThing()
transceiver.broadcast(payload)

Three things in that snippet are worth noting. The comment says to store the transceiver somewhere, like a property, and that is not a style suggestion: a class you let go out of scope is a class whose session ends. The receive call takes the type as a parameter, so registering a handler for SomeCodableThing.self is what tells the library how to decode what arrives, and the closure receives both the decoded payload and the sender, so a peer is identifiable without any extra work. And the send side is called broadcast, which names the delivery semantics rather than pretending it is a one to one send.

The receive signature is what makes the Codable claim work. The type parameter is not a cast performed after the fact, it is the instruction for decoding, so an incoming payload that does not match a registered type simply has no handler.

The Info.plist keys are not optional

The configuration section is the part of the README that will save a developer an afternoon, because it describes a failure that looks like a networking bug.

For MultipeerKit to work when running on iOS 14, the app's Info.plist has to include two keys. The first is Privacy - Local Network Usage Description, NSLocalNetworkUsageDescription, and for that one the README says to include a human-readable description of what benefit the user gets by allowing the app to access devices on the local network. The second is Bonjour services, NSBonjourServices, an array of service types the app browses for, and for MultipeerKit the entry should be in the format _servicename._tcp, where servicename is the serviceType you have set in your MultipeerConfiguration. With the default configuration, the value is _MKSVC._tcp.

Then the line that matters: if you do not configure the above keys properly, then MultipeerKit won't work.

That is a system level permission and a discovery declaration, and getting either wrong produces a session that never finds a peer. The _MKSVC._tcp default is worth writing down, because the service type has to match on every device in the session, and a mismatch is indistinguishable from a network problem when you are debugging.

The two other points in the same section are about how much of this the library decides for you. The service type is configurable through MultipeerConfiguration, which means two apps on the same network can use different service types and will not see each other, and the local network description is a product decision that has to be written for a permission dialog rather than for a developer.

Add it as a Swift package

MultipeerKit is a Swift package, so integration is a dependency entry in Package.swift:

swift
let package = Package(
    ...
    dependencies: [
        .package(url: "https://github.com/insidegui/MultipeerKit.git", from: "0.4.0")
    ],
    ...
)

The from clause starts at version 0.4.0, which is the newest published release.

The repository itself is small, with Sources/, Tests/, the example/ directory, Package.swift and a .swiftpm/ directory, so reading it is a reasonable way to understand the API surface before committing to it. The tests directory means you can see how the library is expected to be driven, which matters for a library whose behaviour depends on a system framework that is awkward to exercise outside a real device session.

The documentation is at a separate site, multipeerkit.rambo.codes, and the README points there for more detail on usage. The example folder holds two sample implementations, MultipeerKitExample and RemoteCamera, and the README's first instruction is simply to check the example folder for a sample implementation, with a demo recording in the repository's assets.

RemoteCamera is the one to look at if you are evaluating the library for a media use case, since a camera stream is exactly the kind of payload where the Codable abstraction is doing the heavy lifting, and where a resource based framework would make you do the encoding by hand.

What the wrapper does not add

The limits of MultipeerKit are the limits of MultipeerConnectivity, and it is worth being clear about them before adopting it.

It is Apple only. The library targets iOS, macOS and tvOS, and the framework underneath is an Apple framework. There is no path from an Android or Linux device into the same session, and no path from a browser either.

It is local. Wi-Fi networks, peer-to-peer Wi-Fi and Bluetooth are all local radio links. A peer on another network, or a friend in another city, is not reachable through this mechanism, and if the product needs that, the design has to include a server that relays, which changes the problem from peer to peer into client and server.

Discovery is limited to the local network, and on iOS 14 and later it is gated behind a user permission, which means the feature fails closed until the user says yes. That is a product decision as much as a technical one, and it is why the README spends a paragraph on writing the permission string.

And the abstraction does not add anything the framework lacks. There is no encryption layer, no delivery guarantee, no conflict resolution, no synchronisation model, because there is no room in the wrapper to add them, and the library's own description is a high-level abstraction, not a networking stack. If a message can be lost and your protocol cannot tolerate that, the protocol has to handle it, and the README does not document a reliability layer, which is a real question to raise before using it for anything stateful.

The release line stopped in 2021 and the repository did not

The version history is the thing to weigh carefully here. The published releases are 0.4.0 on 2021-07-07, 0.3.1 in September 2020 and 0.3.0 in July 2020, and the repository is not archived with the last push on 2026-06-29.

So the newest tag a user can depend on is nearly five years old, while the branch has seen commits as recently as June 2026. That is a gap worth understanding rather than glossing over. Either the library has been stable since 0.4.0 and the recent pushes are maintenance, or there are fixes on main that are not in any release, and the from: 0.4.0 dependency clause would not give you those.

The practical advice is narrow and specific: if you need behaviour beyond the 0.4.0 tag, depend on a branch or a commit hash and accept that you own the upgrade, and if you want the published artefact, read the recent history to see what changed and whether it matters to you.

The licence is BSD-2-Clause, which is the permissive end of the scale and a good fit for a library you might vendor into an app, and the copyright and licence terms are in the LICENSE file at the root.

The wider context is that Apple's own framework has moved on, and a small community wrapper around a system framework is exactly the kind of project that has to keep pace with the operating system. The library's value is in how much of the framework's roughness it removes, and that judgement has not changed since 2021 in either direction.

Editorial conclusion

MultipeerKit suits an Apple platform developer who needs nearby devices to talk to each other without a server, and who is willing to work inside Apple's peer to peer framework and its local network permission model. It does not suit a project that needs peers across the internet, on Android, or on hardware outside the Apple ecosystem, because the framework it wraps is Apple only. Verify first that the version you take still builds against your current SDK, since the newest published release is 0.4.0 from 2021 while the repository itself was pushed in June 2026, and confirm that your Info.plist carries the local network usage description and the Bonjour services entry, because the README is explicit that the library will not work without them.

Frequently asked questions

What is MultipeerKit?

It is a high-level abstraction on top of Apple's MultipeerConnectivity framework, letting iOS, macOS and tvOS devices exchange data over Wi-Fi networks, peer-to-peer Wi-Fi and Bluetooth, with any payload that conforms to Codable.

How do I use MultipeerKit to send a message?

Create a MultipeerTransceiver and keep it alive, call resume() to start it, register a handler with receive(SomeCodableThing.self) { payload, sender in ... }, and send with transceiver.broadcast(payload).

Which Info.plist keys does MultipeerKit need?

NSLocalNetworkUsageDescription and NSBonjourServices. The Bonjour entry should be in the format _servicename._tcp, using the serviceType from your MultipeerConfiguration, which is _MKSVC._tcp with the default configuration, and the README states the library will not work if these are not configured properly.

How do I add MultipeerKit to a Swift project?

As a Swift package, by adding .package(url: "https://github.com/insidegui/MultipeerKit.git", from: "0.4.0") to the dependencies in your Package.swift file.

Can MultipeerKit connect to devices that are not Apple devices?

No. The framework it wraps is Apple's, and the library covers iOS, macOS and tvOS only, over local Wi-Fi, peer-to-peer Wi-Fi and Bluetooth links, so there is no path for a peer on another platform or on a remote network.

Official sources

  1. insidegui/MultipeerKit on GitHub
  2. Issues
  3. License: BSD-2-Clause
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/insidegui-multipeerkit.svg)](https://hysenlabs.com/projects/insidegui-multipeerkit)

Was this useful?