Use the Atlas Device SDK for Swift to develop iOS, macOS, watchOS and tvOS apps in Swift and Objective-C.
Learning Paths
Quick Start
Minimal-explanation code examples of how to work with the Swift SDK. Write to the device database, and sync with other devices.
Working Example App
Learn from example by dissecting a working SwiftUI client app that uses the Swift SDK.
Guided Tutorial
Follow a guided tutorial to learn how to adapt the example app to create your own working app.
What You Can Do
Use the SDK's open-source database - Realm - as an object store on the device. Use Device Sync to keep data in sync with your MongoDB Atlas cluster and other clients.
The SDK's database - Realm - stores objects in files on your device. Or you can open an in-memory database which does not create a file. Configure and open a database to specify the options for your database file.
Use one of our authentication providers to authenticate a user. App Services provides access to popular authentication providers, such as Apple, Google, or Facebook. Use our built-in email/password provider to manage users without a third-party, or use custom JWT authentication to integrate with other authentication providers. Anonymous authentication provides access without requiring a login or persisting user data.
The APIs to read and write data are the same whether you're using a synced or non-synced database. Data that you read and write to the device is automatically kept in sync with your Atlas cluster and other clients. Apps keep working offline and deterministically sync changes whenever a network connection is available.
The Swift SDK offers property wrappers and convenience features designed to make it easier to work with SwiftUI. For example View code that demonstrates common SwiftUI patterns, check out the SwiftUI documentation.
SwiftUI Property Wrappers Offer Realm/SwiftUI Integration
struct SearchableDogsView: View { @ObservedResults(Dog.self) var dogs @State private var searchFilter = "" var body: some View { NavigationView { List { ForEach(dogs) { dog in DogRow(dog: dog) } } .searchable(text: $searchFilter, collection: $dogs, keyPath: \.name) { ForEach(dogs) { dogsFiltered in Text(dogsFiltered.name).searchCompletion(dogsFiltered.name) } } } }}
Essential Documentation
Swift API Reference
Explore generated reference docs for the SDK's Swift APIs.
Explore engineering and expert-provided example projects to learn best practices and common development patterns using the Swift SDK. Check out the Example Projects page for more sample apps.
Analytics/Telemetrics Data
Take sensor readings, push data to Atlas, and display the results in Atlas Charts or a time series collection.
Connection State Change & Error Handling
Learn best practices around handling Sync errors and client resets.
Offline Login and Database Access
Log in a Device Sync user and open a synced database offline.
Integrating In-App Purchases
Use StoreKit to add in-app purchases to a Device Sync-enabled recipe library app.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4