-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NSUbiquitousKeyValueStore
#75
Comments
@hank121314 Any thoughts on this? (Not asking you to do the work. Just want to make sure we end up with the optimal solution) |
The APIs above look good 😃 . Defaults.iCloud.observe(.quality) { change in
print(change.newValue)
} For let publisher = Defaults.iCloud.publisher(.quality).map(\.newValue) And as per Apple docs:
ArtSabintsev/Zephyr synchronize Should we also do this in |
I was thinking that we handle that internally. The user would just use The point of this feature is to handle the sync automatically. All the user has to do is to provide the set of keys that should be synced. Everything else is just normal
Yeah, I think so. |
Got it! Maybe we can add a new For example: Defaults.publisher(.key, options: [.iCloud or .sync]) |
What's the use-case? |
I am not sure what kinds of use-case honestly. |
Yes, but I'm curious why people would need to listen to I feel like we're maybe talking past each other. With my solution, Defaults would listen to |
Yeah! That's the main feature. |
I think a property on the |
Yeah! Let's just keep an open mind to this additional feature.
That's true 👍. Learn a lot from it 😃 ! |
It was missing by the time I needed it so I implemented something on my own (locally) for now but it's not as deeply integrated as what you plan on adding and relies on me checking for |
This is now available for testing: https://github.com/sindresorhus/Defaults/releases/tag/v9.0.0-beta.1 |
https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore
It would be nice to be able to mark keys as being sync'able and have them be automatically synced with iCloud. Syncing settings/data is a very common need, but it's currently difficult to get right. We could make it super easy.
UserDefaults
would still be the main storage, as per Apple docs:We could take some inspiration from https://github.com/ArtSabintsev/Zephyr:
We could also make a key syncable by default:
@hank121314 Thoughts on the idea and the API?
The text was updated successfully, but these errors were encountered: