Repository navigation
0.9.0
CloudKit Sync Support + Enhanced Configuration Options
This release adds CloudKit synchronization capabilities and additional configuration flexibility to NnSwiftDataKit.
What's New
- CloudKit Sync Support: Enable iCloud syncing for your SwiftData stores with the new
cloudKitDatabaseIdparameter - Named Stores: Use the
nameparameter to manage multiple stores within the same App Group container - Read-Only Mode: Set
readOnly: trueto disable saves and treat stores as read-only - Private CloudKit Databases: Full support for syncing to private CloudKit databases
API Enhancements
Both makeAppGroupConfiguration and makeAppGroupModelContainer now accept:
name: String?- Optional store identifierreadOnly: Bool- Read-only mode toggle (default:false)cloudKitDatabaseId: String?- CloudKit container ID for sync
Example Usage
// Enable CloudKit sync
let (container, defaults) = try makeAppGroupModelContainer(
schema: Schema([MyModel.self]),
appGroupId: "group.com.example.app",
cloudKitDatabaseId: "iCloud.com.example.app"
)
// Create a named, read-only store
let (config, defaults) = try makeAppGroupConfiguration(
name: "ReadOnlyStore",
appGroupId: "group.com.example.app",
readOnly: true
)Backward Compatibility
All new parameters have default values, so existing code continues to work without any modifications.
Full Changelog: https://github.com/nikolainobadi/NnSwiftDataKit/blob/main/CHANGELOG.md