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
- Open the terminal
- Clone the repository from GitHub.
git clone https://github.com/getditto/quickstart - 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
-
From the
quickstartdirectory, copy.env.sampleto.env: -
Set the Database ID, Development Token, and Server URL in
.env: -
Generate the Swift configuration file from
.env:
3. Run the Application
- Launch Xcode and open the
Tasks.xcodeprojproject. - To run on a physical device, configure the Team under Signing & Capabilities for your Apple Developer account. A simulator does not require this step.
- Select a Build Target
- In Xcode, choose a connected iOS device or an iOS Simulator as the run destination.
- Build the Application
- From the Xcode menu, select
Product > Build. - This compiles the app using the
Tasks/Env.swiftfile generated in the previous step.
- From the Xcode menu, select
- Run the Application
- Select
Product > Runto launch the app on your selected device or simulator.
- Select
4. Sync-Data Offline
- Launch the application on multiple devices or simulators
- Disconnect from your current WiFi network while keeping WiFi enabled on the device to allow for LAN connections
- Add, edit, and delete tasks and experience offline collaboration!