Skip to content

2.0.0

Latest

Choose a tag to compare

@KthKuang KthKuang released this 21 Jul 12:02
4a7f714

Breaking changes

  • Injectable store: .iCloudKV keys now resolve their store through the new defaultiCloudKVStore dependency (live value: NSUbiquitousKeyValueStore.default). Tests and previews automatically get an in-memory store, so features using .iCloudKV no longer require iCloud entitlements and never touch the real key-value store.
  • Load semantics: loading a key that has no persisted value seeds the default into the store and reports "no value" instead of echoing the default back, so SharedReader(require:) and manual loads can distinguish a missing value from a loaded one. Undecodable data behaves the same way.
  • Quota errors: iCloud quota violations now surface as a typed iCloudKVQuotaError through the shared value's loadError, in addition to the reportIssue warning. The quota is a store-wide condition, so every key subscribed to the affected store receives the error.
  • Key identity: a key's ID now includes the store it reads from, so two keys with the same name but different stores no longer share state.

New

  • Every .iCloudKV factory accepts a store: parameter for explicit per-key store injection, and NSUbiquitousKeyValueStore.inMemory provides isolated stores. Each access to .inMemory creates a brand-new store — hold one instance and pass that same instance everywhere the key is declared.
  • Any Codable value can be stored; it is persisted as JSON-encoded data.
  • [String] and [String]? key overloads.
  • The iCloudKVWarningsEnabled dependency gates the key-length, entitlement, and quota warnings.
  • SharingCloud re-exports Sharing, so a single import SharingCloud suffices.

Fixed

  • Setting an optional codable value to nil removes the key instead of persisting JSON null.

Tooling

  • New test suite with 23 Swift Testing cases covering store isolation, seeding, persistence, external change notifications, quota errors, and type roundtrips.
  • justfile recipes for build, test, format, lint, and cross-compiling against the iOS, tvOS, and watchOS device SDKs.
  • Direct dependencies declared explicitly; sources formatted with swift-format.

Full Changelog: 1.0.0...2.0.0