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

`Color.Resolved` is `Codable`, so we should use that for the serialization.

https://developer.apple.com/documentation/swiftui/color/resolve(in:) https://developer.apple.com/documentation/swiftui/color/resolved It should be able to store the color better than what we currently do. We still need to preserve backwards compatibility, so we can first try loading it...

enhancement
help wanted

```swift struct User3: Codable, Defaults.Serializable { let name: String let age: String } extension Defaults.Keys { static let user3 = Key("user3", default: .init(name: "Hello", age: "24")) } ... func test2()...

enhancement
help wanted

Sometimes you need to store something that is a bit larger, like a icon image. Storing this in UserDefaults would be slow as it has to be decoded each time...

I think we can finally support `@Default` in observable classes. More info: https://github.com/apple/swift-evolution/blob/main/proposals/0395-observability.md `@Obserable` expands class properties to: ```swift var order: Order? { get { self.access(keyPath: \.order) return _order }...

There's no way to prevent it today, but maybe when Swift supports macros or constant expressions. I have seen many users do: ```swift static let interval = Key("interval", default: nil)...

Some ideas for version 10. It will not happen for a long time. - [ ] Deprecate `.observe()` and `.publisher()`: https://github.com/sindresorhus/Defaults/issues/71

I wonder if we could use macros to simplify some things?

tag project without "v" to be compliant with semantic versioning, used by SPM. Thanks.