Add support for serializing `NSFontDescriptor` and `UIFontDescriptor`
This commit is contained in:
parent
ce45591c09
commit
23e0a4497e
|
@ -168,6 +168,12 @@ extension NSColor: Defaults.Serializable {}
|
|||
extension UIColor: Defaults.Serializable {}
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
extension NSFontDescriptor: Defaults.Serializable {}
|
||||
#else
|
||||
extension UIFontDescriptor: Defaults.Serializable {}
|
||||
#endif
|
||||
|
||||
extension NSUbiquitousKeyValueStore: DefaultsKeyValueStore {}
|
||||
extension UserDefaults: DefaultsKeyValueStore {}
|
||||
|
||||
|
|
13
readme.md
13
readme.md
|
@ -54,13 +54,16 @@ Add `https://github.com/sindresorhus/Defaults` in the [“Swift Package Manager
|
|||
- `Data`
|
||||
- `URL`
|
||||
- `UUID`
|
||||
- `NSColor` (macOS)
|
||||
- `UIColor` (iOS)
|
||||
- `Color` [^1] (SwiftUI)
|
||||
- `Color.Resolved` [^1] (SwiftUI)
|
||||
- `Range`
|
||||
- `ClosedRange`
|
||||
- `Codable`
|
||||
- `NSSecureCoding`
|
||||
- `Range`, `ClosedRange`
|
||||
- `Color` [^1] (SwiftUI)
|
||||
- `Color.Resolved` [^1] (SwiftUI)
|
||||
- `NSColor`
|
||||
- `UIColor`
|
||||
- `NSFontDescriptor`
|
||||
- `UIFontDescriptor`
|
||||
|
||||
Defaults also support the above types wrapped in `Array`, `Set`, `Dictionary`, `Range`, `ClosedRange`, and even wrapped in nested types. For example, `[[String: Set<[String: Int]>]]`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue