Skip to main content

iOS Installation Instructions

  1. Ensure you have CocoaPods 1.1.0 or later
  2. Ensure you have use_frameworks! in your Podfile
  3. Add DittoSwift to your Podfile like so:
pod 'DittoSwift'

If you are installing for an Objective-C project use the following CocoaPod instead.

pod 'DittoObjC'
  1. Add the following permissions in your Info.plist so that your app can use all the necessary communication channels. Right click on your project's Info.plist file, click Open As > Source Code.

Example banner

  1. Add the following keys.
<key>NSBluetoothAlwaysUsageDescription</key><string>Uses Bluetooth to connect and sync with nearby devices</string><key>NSBluetoothPeripheralUsageDescription</key><string>Uses Bluetooth to connect and sync with nearby devices</string><key>NSLocalNetworkUsageDescription</key><string>Uses WiFi to connect and sync with nearby devices</string><key>NSBonjourServices</key><array>  <string>_http-alt._tcp.</string></array>

The values like <string>Uses WiFi to connect and sync with nearby devices</string> will be displayed in a prompt. Replace it with whatever language is best for your users.

  1. You can now use Ditto in your application:
import DittoSwift
let ditto = Ditto()try! ditto.setLicenseToken("my license token")try! ditto.tryStartSync()