Defaults icon indicating copy to clipboard operation
Defaults copied to clipboard

💾 Swifty and modern UserDefaults

Results 47 Defaults issues
Sort by recently updated
recently updated
newest added

I just implemented a today widget in one of my apps. I needed to read a preference item in the today widget that was currently stored in my main app....

enhancement
help wanted

`UserDefaults.didChangeNotification` triggers for any kind of user defaults change in the process. Even for included SDK or even Apple's APIs. This makes it both inefficient and dangerous. I just had...

enhancement

Help welcome to add more tests :)

help wanted
good first issue

We currently wrap all saved values in an array: https://github.com/sindresorhus/Defaults/blob/55ffea9487fb9b559406d909ee31dcd955fe77aa/Sources/Defaults/Defaults.swift#L325-L327 This issue was fixed in macOS 10.15, iOS 13, etc, so it's not needed anymore on those platforms. However, we...

enhancement
help wanted

https://www.hackingwithswift.com/articles/55/how-to-use-dynamic-member-lookup-in-swift Would be nice to refer to keys as `Defaults.key` instead of `Defaults[.key]`.

question

Currently, we have to wrap the Codable value in an array, since `JSONEncoder` can't handle top-level fragments. This might be possible in the future though, so please comment your opinions...

Hey guys, I am having problems with my custom Codable struct that I am persisting through Defaults. I have created the workaround as described in #93 and I am using...

Current: ```swift extension Foo: Defaults.Serializable, Defaults.PreferRawRepresentable {} ``` I think this may be better: ```swift extension Foo: Defaults.Serializable.RawRepresentable {} ``` This is shorter, but more importantly, it makes the choice...

Since using this library, we are seeing some crash reports which look related to KVO and UserDefaults. We haven't been able to reproduce them but are seeing crash reports on...

## Summary This PR fixes: #75 Create a `Defaults.iCloud` class which facilitates the synchronization of keys between the local `UserDefaults` and `NSUbiquitousKeyValueStore`. This class utilizes a `TaskQueue` to execute synchronization...