Skip to main content

Prerequisites

Ditto’s Swift Quickstart supports iOS. Before getting started, ensure you have the following:
  • A macOS machine with Xcode 26.2 or later installed
  • A code editor (Xcode is recommended)
  • Git installed on your machine
  • A Ditto Portal account with a configured Ditto Database (see Getting SDK Connection Details)
  • A physical iOS device or an iOS simulator for testing

Get Started

1. Clone the Repository

  1. Open the terminal
  2. Clone the repository from GitHub.
    git clone https://github.com/getditto/quickstart
  3. Navigate to the project directory:
    cd quickstart

2. Configure Ditto

In the Ditto Portal, open your database’s Connect via SDK tab and copy its Database ID, Development Token, and URL.

Add Ditto Credentials

  1. From the quickstart directory, copy .env.sample to .env:
  2. Set the Database ID, Development Token, and Server URL in .env:
  3. Generate the Swift configuration file from .env:

3. Run the Application

  1. Launch Xcode and open the Tasks.xcodeproj project.
  2. To run on a physical device, configure the Team under Signing & Capabilities for your Apple Developer account. A simulator does not require this step.
  3. Select a Build Target
    • In Xcode, choose a connected iOS device or an iOS Simulator as the run destination.
  4. Build the Application
    • From the Xcode menu, select Product > Build.
    • This compiles the app using the Tasks/Env.swift file generated in the previous step.
  5. Run the Application
    • Select Product > Run to launch the app on your selected device or simulator.

4. Sync-Data Offline

  1. Launch the application on multiple devices or simulators
  2. Disconnect from your current WiFi network while keeping WiFi enabled on the device to allow for LAN connections
  3. Add, edit, and delete tasks and experience offline collaboration!

Next Steps

All the Ditto Quickstart apps work together! Try running a quickstart app in other languages and see them all collaborate.

Additional Resources