Breaking changes
- Injectable store:
.iCloudKVkeys now resolve their store through the newdefaultiCloudKVStoredependency (live value:NSUbiquitousKeyValueStore.default). Tests and previews automatically get an in-memory store, so features using.iCloudKVno 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
iCloudKVQuotaErrorthrough the shared value'sloadError, in addition to thereportIssuewarning. 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
.iCloudKVfactory accepts astore:parameter for explicit per-key store injection, andNSUbiquitousKeyValueStore.inMemoryprovides isolated stores. Each access to.inMemorycreates a brand-new store — hold one instance and pass that same instance everywhere the key is declared. - Any
Codablevalue can be stored; it is persisted as JSON-encoded data. [String]and[String]?key overloads.- The
iCloudKVWarningsEnableddependency gates the key-length, entitlement, and quota warnings. SharingCloudre-exportsSharing, so a singleimport SharingCloudsuffices.
Fixed
- Setting an optional codable value to
nilremoves the key instead of persisting JSONnull.
Tooling
- New test suite with 23 Swift Testing cases covering store isolation, seeding, persistence, external change notifications, quota errors, and type roundtrips.
justfilerecipes 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