Releases: sindresorhus/Defaults
Releases · sindresorhus/Defaults
v7.2.1
- Fix infinite recursion when casting AnySerializable to wrong type 03d5386
v7.2.0
- Switch from deprecated NSSecureCoding API
- If you have a custom bridge that accepts a
NSSecureCoding
object, you will have to make itNSSecureCoding
→NSSecureCoding & NSObject
- If you have a custom bridge that accepts a
v7.1.0
Defaults
will now show a runtime warning inside Xcode if you use a unsupported key name.- If you don't want to import this package in every file you use it, add the below to a file in your app. You can then use
Defaults
and@Default
from anywhere without an import.import Defaults typealias Defaults = _Defaults typealias Default = _Default
v7.0.0
Breaking
- Target macOS 10.15, iOS 13, tvOS 13, watchOS 6 ea11b7a
- Require Xcode 14.1
Improvements
- Add
.updates()
method to observe updates to values 7a22d37- I recommend moving to this method from
.observe()
and.publisher()
. While these methods will remain for a while, they will eventually be deprecated in favor of.updates()
.
- I recommend moving to this method from
- Support dynamic default value fbc67fd
- Support serializing and deserializing nested custom types be7e30b
v6.3.0
v6.2.1
The Swift version included in Xcode 13.3 has a bug that affects Defaults. If you get a compile error, see the workaround. Make sure you also upgrade to Defaults v6.2.1 (this version).
v6.2.0
- Add support for
UUID
v6.1.0
v6.0.0
Breaking
- New platform requirements:
- macOS 10.12 → 10.13
- iOS 10 → 12
- tvOS 10 → 12
- watchOS 3 → 5
Improvements
- Add
.defaultValue
and.isDefaultValue
to@Default
#76 - Add
Defaults.AnySerializable
#73 - Support types that conform to both
Codable
andNSSecureCoding
#80 - Add
Defaults.PreferNSSecureCoding
andDefaults.PreferRawRepresentable
#83
Fixes
- Fix archive error with Xcode 13 #81
v5.0.0
Breaking
- Please read the migration guide.
- Removed
NSSecureCodingKey
andNSSecureCodingOptionalKey
.- You can now just use
Key
instead.
- You can now just use
- Dropped support for Carthage and CocoaPods.
- If you use either of these, you can still use Swift Package Manager just for this package.
Improvements
- Added support for more built-in Swift types.
- Improved the stored representation of many types.
- For example,
Array
is now stored as a native UserDefaults array instead of being stored as a JSON stringified string. Same withSet
andDictionary
.
- For example,
- Enums no longer need to be
Codable
. (Existing usage requires migration) - Added support for storing
NSColor
andUIColor
. - Added
Defaults.Toggle
.
Meta
Huge thanks to @hank121314 for doing a lot of the work on this release.