Skip to content

0.9.0

Latest

Choose a tag to compare

@nikolainobadi nikolainobadi released this 08 Dec 23:06

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 cloudKitDatabaseId parameter
  • Named Stores: Use the name parameter to manage multiple stores within the same App Group container
  • Read-Only Mode: Set readOnly: true to 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 identifier
  • readOnly: 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