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 {}
|
extension UIColor: Defaults.Serializable {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if os(macOS)
|
||||||
|
extension NSFontDescriptor: Defaults.Serializable {}
|
||||||
|
#else
|
||||||
|
extension UIFontDescriptor: Defaults.Serializable {}
|
||||||
|
#endif
|
||||||
|
|
||||||
extension NSUbiquitousKeyValueStore: DefaultsKeyValueStore {}
|
extension NSUbiquitousKeyValueStore: DefaultsKeyValueStore {}
|
||||||
extension UserDefaults: 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`
|
- `Data`
|
||||||
- `URL`
|
- `URL`
|
||||||
- `UUID`
|
- `UUID`
|
||||||
- `NSColor` (macOS)
|
- `Range`
|
||||||
- `UIColor` (iOS)
|
- `ClosedRange`
|
||||||
- `Color` [^1] (SwiftUI)
|
|
||||||
- `Color.Resolved` [^1] (SwiftUI)
|
|
||||||
- `Codable`
|
- `Codable`
|
||||||
- `NSSecureCoding`
|
- `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]>]]`.
|
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