High-level Swift wrapper for the Nabto Edge Client SDK. Distributed as a Swift Package; the underlying low-level C SDK is pulled in as a binary XCFramework from the nabto-client-sdk-releases repository.
Supports iOS 13+ and macOS 10.15+.
File → Add Package Dependencies… and enter:
https://github.com/nabto/edge-client-swift
Add the NabtoEdgeClient library product to your target.
dependencies: [
.package(url: "https://github.com/nabto/edge-client-swift", from: "4.0.0")
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "NabtoEdgeClient", package: "edge-client-swift")
]
)
]For broader integration guidance, see the iOS getting started guide.
See the API intro for an overview of how to use the wrapper to invoke Nabto Edge devices.
A minimal SwiftUI example app lives in NabtoEdgeClientHello/ — see its README for build instructions. For more detailed usage of individual SDK features, the integration tests are the most complete reference.
git clone git@github.com:nabto/edge-client-swift.git
cd edge-client-swift
swift buildOr open Package.swift directly in Xcode:
open Package.swiftMost tests run against central Nabto-hosted test devices. A few cover mDNS discovery and require a local device — those are opt-in.
swift testmDNS-dependent tests skip with a clear message. This is what CI runs (see .github/workflows/ci.yml).
First start a local simple_mdns_device in another terminal:
git clone --recursive git@github.com:nabto/nabto-embedded-sdk.git
cd nabto-embedded-sdk
mkdir _build && cd _build
cmake -j ..
./examples/simple_mdns/simple_mdns_device pr-mdns de-mdns swift-test-subtype swift-txt-key swift-txt-valThen run the suite with the opt-in flag:
NABTO_TEST_LOCAL_MDNS_DEVICE=1 swift testFrom Xcode: open Package.swift, edit the NabtoEdgeClientTests scheme → Run → Arguments → Environment Variables, and add NABTO_TEST_LOCAL_MDNS_DEVICE = 1. Then Product → Test (⌘U).