How SwiftData's On-Device Architecture Guarantees Case Data Never Leaves the Device
Apple's SwiftData framework, introduced in iOS 17, provides a local-only persistence layer that makes on-device-first case management not just possible but architecturally simpler than cloud alternatives. Here is how the technology works and why it matters for attorney privacy.
Before iOS 17, building a truly on-device iOS app required choosing between Core Data (powerful but complex, with a steep learning curve and verbose boilerplate) and lighter-weight solutions like UserDefaults or property list serialization (simple but unsuitable for structured relational data). Neither option was ideal for a case management application that needs to model cases, courts, jurisdictions, hearing dates, and notes with relationships, sorting, filtering, and search — all without a network connection.
SwiftData changes that calculus. Introduced at WWDC 2023 alongside iOS 17, SwiftData is Apple's modern persistence framework that provides a Swift-native, macro-driven API for object graph management and persistence. Critically for privacy-focused applications, SwiftData's default configuration stores data in a local SQLite store on the device — not in iCloud, not on a remote server, and not in any vendor-controlled infrastructure.
Local-Only by Default
The most important privacy property of SwiftData for case management is that it is local-only by default. A standard SwiftData model requires no network configuration, no server URL, and no cloud entitlement to function. The framework creates a SQLite database file in the application's sandboxed Documents directory, and all data operations — create, read, update, delete — operate on that local file.
@Model
final class Case {
var caseName: String
var caseNumber: String
var court: String
var jurisdiction: String
var practiceArea: String
var status: String
var nextHearingDate: Date?
var notes: String
init(caseName: String, caseNumber: String, court: String,
jurisdiction: String, practiceArea: String,
status: String, nextHearingDate: Date? = nil,
notes: String = "") {
self.caseName = caseName
// ...
}
}
This is fundamentally different from apps that are "local-first" but still require network access for sync, backup, or analytics. Many cloud-based case management apps offer offline mode — data is cached locally for offline access — but the local cache is a copy of server-side data, and the authoritative store remains on the vendor's servers. SwiftData in its local-only configuration has no server-side store. The authoritative data is the data on the device.
iOS Data Protection and Encryption at Rest
SwiftData inherits iOS Data Protection, which provides file-level encryption based on the device's passcode. When the device is locked, the SwiftData store file is encrypted and inaccessible to any process running on the device. iOS Data Protection offers four levels of protection; the default (NSFileProtectionDefault) protects the file when the device is locked but allows access while the device is unlocked. For case management data, this means:
- Device locked: The SwiftData store is encrypted and cannot be read by any process, including malware or forensic tools running on a locked device.
- Device unlocked: The app can read and write the store normally. The user's case data is accessible while the app is in active use.
- Device passcode required: iOS Data Protection is only available when a device passcode is set. Attorneys using Docketloom should ensure device passcode (preferably alphanumeric) is enabled.
This encryption is transparent to the app — SwiftData handles it automatically. The attorney does not need to configure encryption, manage keys, or implement custom cryptographic logic. The level of protection is determined by the device's security configuration and iOS Data Protection settings.
No Network Access Required
A SwiftData-based case management app does not require network access to function. The app stores and retrieves data from the local SQLite file. This has important privacy implications beyond the obvious benefit of no data transmission:
- No network permissions needed: The app can function with networking entirely disabled. This eliminates an entire class of privacy and security risks.
- No analytics: Because the app does not need network access for its core function, there is no need for analytics SDKs that would transmit usage data. An on-device case management app can be designed with zero network dependencies.
- No third-party SDKs: Cloud sync, push notifications, and remote authentication are all unnecessary when data is local-only. This eliminates the privacy and security risks associated with third-party SDKs.
- No attack surface: With no server infrastructure, there is no server-side attack surface. No database server to compromise, no API endpoints to exploit, no authentication tokens to steal.
Persistence: Local SQLite store in app sandbox — no server, no cloud service, no network dependency.
Encryption at rest: iOS Data Protection provides file-level encryption tied to device passcode. Automatic — no key management required.
Encryption in transit: Not applicable — no data is transmitted. There is nothing to intercept.
Backup: Data is included in standard iOS device backups (encrypted backups recommended). Backup encryption is managed by the user through iOS settings.
Access control: Device-level authentication (passcode, Face ID, Touch ID) controls access to the device and therefore to the case data.
Why This Architecture Matters for Case Management
Case management data is among the most sensitive information an attorney handles. It includes client names, case strategies, litigation timelines, settlement figures, and notes on privileged communications. For every piece of case data that leaves the attorney's device and enters a cloud platform, the attorney must analyze whether that transmission creates a privilege waiver, whether the vendor's security is adequate, and whether the vendor's data practices comply with ethical obligations.
SwiftData's on-device architecture eliminates these questions. The architectural choice of local-only persistence is not a feature that needs to be verified or audited — it is a property of the framework. Attorneys can adopt the tool with confidence that their case data is not being transmitted, processed, or stored by any third party, because the framework does not support those operations without explicit developer opt-in.
For attorneys who prioritize client confidentiality and data sovereignty, SwiftData's local-only architecture is not a compromise — it is an advantage over cloud-based alternatives that require ongoing trust in third-party infrastructure.
This content is legal information, not legal advice. It does not create an attorney–client relationship and cannot substitute for consultation with a licensed attorney about your specific circumstances.