Flow

Swift SDK

A real Pilot node inside your iOS or macOS app — embedded daemon, no separate process, sandbox-clean.

What you get

The daemon is compiled to a static library inside an XCFramework; your app links it and calls a Swift API. Requires iOS 14+ or macOS 12+, Swift 5.9+.

Install

dependencies: [
    .package(url: "https://github.com/pilot-protocol/sdk-swift.git", from: "0.1.0"),
],
targets: [
    .target(name: "YourApp", dependencies: [
        .product(name: "Pilot", package: "sdk-swift"),
    ]),
]

Or in Xcode: File → Add Package Dependencies… and paste the repo URL.

Quick start

import Pilot

// Start the embedded daemon (no separate process needed).
let pilot = try Pilot.start(.init(
    dataDir: dataDir,
    socketPath: "p.sock",
    trustAutoApprove: true,
    keepaliveSeconds: 30
))
print("address=\(pilot.start.address)")

// Handshake, then send once trusted:
try pilot.handshake(peerID: 12345, justification: "hello")
_ = try pilot.waitForTrust(peerID: 12345, timeoutMs: 30_000)
try pilot.send(to: "0:0000.0000.AAAA", port: 7777, data: Data("hi".utf8))

Full API and examples: pilot-protocol/sdk-swift. Where the three SDKs differ, see SDK Parity.