iOS Client SDK (Swift)

The recommended way to integrate the Nabto Edge Client SDK in your iOS application is to use the high level Swift based iOS Client SDK. It is installed with Swift Package Manager from the edge-client-swift github repository. The SDK is a thin wrapper around the Plain C Client SDK for iOS.

INSTALLATION

In your .xcodeproj or .xcworkspace, add the package by pressing File > Add Package Dependencies... and entering the package URL https://github.com/nabto/edge-client-swift. Then go to the settings for your target in your Xcode project and add NabtoEdgeClient to the “Frameworks, Libraries, and Embedded Content” option.

If you are using a Package.swift file to specify dependencies, first add the following line to the dependencies list.

.package(url: "https://github.com/nabto/edge-client-swift.git", from: "4.0.1")

Then add NabtoEdgeClient to your target’s dependencies:

.target(name: "example", dependencies: ["NabtoEdgeClient"]),

USE THE SDK

To use the Nabto Edge iOS Client SDK, add the following to your source file:

import NabtoEdgeClient

Now you can invoke the SDK:

print(NabtoEdgeClient.Client.versionString())

The Client class is the main entry point for the SDK, from here you can create Connection objects that in turn can be used with the available communication patterns (Nabto Edge CoAP, Streams and Tunnels).

See the API docs for more details. The Concepts and Best Practices guide has code snippets and explanations for key use cases. Or see the full example apps in the section to the left for remote control and video.