sindresorhus / Defaults

💾 Swifty and modern UserDefaults
https://swiftpackageindex.com/sindresorhus/Defaults/documentation/defaults
MIT License
1.98k stars 119 forks source link

Improve check for natively supported values #51

Closed sindresorhus closed 3 years ago

sindresorhus commented 4 years ago

https://github.com/apple/swift-corelibs-foundation/blob/ef6f96ee82ea0f54252071c0ecadf5f01be9aecc/Foundation/UserDefaults.swift#L26-L64

Seems we could also support NSNumber and various Int* types.

Even arrays of values (https://github.com/sindresorhus/Defaults/issues/47).

We could also adopt the approach of using a protocol to define the natively supported types: https://www.vadimbulavin.com/advanced-guide-to-userdefaults-in-swift/

sindresorhus commented 3 years ago

Fixed by #57