SDK Setup Guides
...
Quick Tips for Swift
Preventing SwiftUI Previews from Syncing
when developing with swiftui, you may notice that data from a regular simulator or physical device will sync with a mysterious "other" device this mysterious device is most likely the swiftui preview simulator simply closing xcode doesn't guarantee that this preview simulator closes in order to stop this from happening, you'll need to prevent swiftui preview simulator from calling startsync if you want to check that your runtime is running as a swiftui preview, you can read the process environment variables like so let ispreview bool = processinfo processinfo environment\["xcode running for previews"] == "1" to prevent your ditto instance in the preview from syncing, ensure to wrap startsync() in an if clause like so although a ditto instance that has not previously invoked startsync is unable to connect or replicate to discoverable devices, it can perform local datastore operations upsert (insert), find, observe, update, and remove let ispreview bool = processinfo processinfo environment\["xcode running for previews"] == "1" if !ispreview { // non preview simulators and real devices can sync try ditto startsync() }