CodableUserDefault

@propertyWrapper
public struct CodableUserDefault<Key, Value> where Key : RawRepresentable, Value : Decodable, Value : Encodable, Key.RawValue == String

Usage notes: CodableUserDefault vs. PlistUserDefault

PlistUserDefault supports plist-compatible types: Data, String, Number, Date, Array and Dictionary.

CodableUserDefault supports any type conforming to the Codable protocol (which includes plist-compatible types, but also structs and enums conforming to Codable.

Note: PlistUserDefault must be used for settings declared in Settings.bundle/Root.plist (because these are stored in type-specific formats, while CodableUserDefault stores/retrieves all types as Data).