Replies: 1 comment 2 replies
-
If this seems worth implementing for the library, are there any issues with the proposal? If it looks good to you, I would like to begin the implementation. @stephencelis @mbrandonw |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Support for iCloud KV Storage
Motivation
NSUbiquitousKeyValueStore
enables developers to seamlessly store and sync app preferences, configuration, and state data across all devices linked to a user's iCloud account using lightweight key-value storage. It would be beneficial to add support for this feature to enable swift-sharing, addressing the limitations of@AppStorage
in SwiftUI.Implementation
The interface for
NSUbiquitousKeyValueStore
is similar toUserDefaults
:Any changes made to this value will be synchronized to iCloud key-value storage. Further, any change made to the "isOn" key in iCloud will be immediately played back to the
@Shared
value, as demonstrated in this test:The implementation of the iCloudKV strategy will be similar to
AppStorageKey.swift
, but it will replaceUserDefaults
withNSUbiquitousKeyValueStore
.Limitations
We will address the above limitations by warning the developer with
IssueReporting
.Beta Was this translation helpful? Give feedback.
All reactions