This project hasn't been updated in a long time, so it no longer appears on the homepage, categories, or search results — the data is preserved and this page still works normally.
RepositorySwiftUSUnited States
kirankunigiri

kirankunigiri/Apple-Family

A simple framework that brings Apple devices together - like a family

66stars
5forks
1issues
0views

Banner

Apple Family Platform

License MIT Build Passing

A simple framework that brings Apple devices together - like a family. It will automatically use bluetooth, wifi, or USB to connect and communicate with other Apple devices and share information. Currently supports iOS and macOS.

This library is a combination of 2 others I wrote: Apple Signal for wifi and bluetooth communication, and Peertalk Simple for USB communication. Check them out if you only want one of these features.

Demo

Banner

Installation

Grab the files from the source folder and drag them to your project! You also need to have peertalk by Rasmus installed.

Example

Family is simple to setup. Just start the connection, and you can start sending and receiving data! Check out the Xcode demo project for a full implementation .

Setup

Start the connection. Specify a port number, which can be any 4 digit number, and a service type, which is a string limited to 15 characters and 1 hyphen. In order to be discovered, a device must use the same port number and service type. There are also multiple connection types for wifi/bluetooth connectivity. Check the Signal docs for a description of each Signal type.

Family.instance.delegate.addDelegate(delegate: self)
Family.instance.initialize(portNumber: 2345, serviceType: "family-example", signalType: .Automatic)

Next, we also need to run a method in the App Delegate when the app restarts because the usb connection automatically disconnects when the iPhone is put to sleep.

func applicationDidBecomeActive(_ application: UIApplication) {
    Family.instance.reconnect()
}

Send Data

In Family, you can add a tag to the data you send so that the receiver knows what the data is. You can create a UInt32 enum to manage them. Here's an example:

enum DataType: UInt32 {
    case string = 100
    case image = 101
}

Send some text, and specify its type using our enum. Family automatically converts objects to data using NSKeyedArchiver, so if you want to send your own data, use the sendData method instead.

Family.instance.sendObject(object: "Hello World!", type: DataType.string.rawValue)

Receive Data (Protocol)

The protocol conformation. We get the data, check its type, convert it back to the according object, and update our UI. The class has an extension to the Data class - the method convert() - that uses the NSKeyedArchiver class to convert data back into the object you need. You can also update the list of connected devices with the second method.

func family(didReceiveData data: Data, ofType type: UInt32) {
    if type == DataType.string.rawValue {
        let string = data.convert() as! String
    } else if type == DataType.image.rawValue {
        let image = UIImage(data: data)
    }
}

func family(connectedDevicesChanged devices: [String]) {}

And we just setup communication session between devices. It's that simple!

Contribute

Feel free to to contribute to the project with a pull request or open up an issue for any new features or bug fixes.

Similar Projects

Discover other similar projects and AI models.

RepositorySwift
permissionlesstech/bitchat

bluetooth mesh chat, IRC vibes

36.8k
Oct 25, 2026
RepositoryDart
flutter/flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

180.4k
Oct 26, 2026
RepositoryGo
FiloSottile/mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.

59.8k
Aug 13, 2024
RepositoryDart
Predidit/Kazumi

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

39.7k
Oct 26, 2026
RepositorySwift
utmapp/UTM

Virtual machines for iOS and macOS

36.5k
Oct 20, 2026
RepositoryC++
justcallmekoko/ESP32Marauder

A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32

12.9k
Oct 23, 2026
RepositoryGo
schollz/find3

High-precision indoor positioning framework, version 3.

4.8k
Dec 30, 2022
RepositoryJava
fr3ts0n/AndrOBD

Android OBD diagnostics with any ELM327 adapter

2.2k
Oct 19, 2026
RepositoryC++
cifertech/RF-Clown

BLE and Bluetooth Jammer with nRF24L01 and ESP32

1.9k
Jun 6, 2026