Releases: orchetect/swift-prefs
Releases · orchetect/swift-prefs
Release list
2.0.0
1.3.7
Maintenance
- Now uses latest major version of
swift-syntaxdependency where possible, maintaining backwards compatibility - Reworked package and imports to remove spurious compiler dependency warnings
- Updated GitHub CI for recent changes in action runners
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
New
- Added
CodableArrayPrefsCoding. Usage:@Pref(coding: [MyCodableType].jsonDataArrayPrefsCoding) var foo: [MyCodableType]? @Pref(coding: [MyCodableType].jsonStringArrayPrefsCoding) var foo: [MyCodableType]?
- Added
CodableDictionaryPrefsCoding. Usage:@Pref(coding: [String: MyCodableType].jsonDataDictionaryPrefsCoding) var foo: [String: MyCodableType]? @Pref(coding: [String: MyCodableType].jsonStringDictionaryPrefsCoding) var foo: [String: MyCodableType]?
- Added
RawRepresentableArrayPrefsCoding. Usage:@Pref(coding: [MyRawType].rawRepresentableArrayPrefsCoding) var foo: [MyRawType]?
- Added
RawRepresentableDictionaryPrefsCoding. Usage:@Pref(coding: [String: MyRawType].rawRepresentableDictionaryPrefsCoding) var foo: [String: MyRawType]?
Maintenance
- Updated README
- Added unit tests
1.3.1
New
- Added new
@RawPrefpref macro for[Any]and[String: Any]preference value types PrefsStorage: AddedsetUnsafeStorageValue(forKey: String, to: Any?)methodPrefsStorage: ChangedstorageValue(forKey:)methods returning[Any]?and[String: Any]?to a single method returningAny?
See updated README for more details.
1.3.0
PrefsKit 1.3.0
Note
PrefsKit 1.3.0 is a major update and brings substantial new features and robustness to existing features.
Note that this version brings some breaking changes since 1.2.x.
Tip
See the updated README.md for documentation on the new features.
New
- Prefs storage backends capabilities have been expanded (#9) to allow:
- initializing from plist, JSON, or custom serialization formats
- importing content from plist, JSON, or custom serialization formats, replacing or merging with existing storage contents
- exporting the storage as plist, JSON, or custom serialization formats
Dateis added as an atomic type.
Its default encoding uses the ISO8601 format thatNSDateencodes for plists. This allows cross-compatibility between UserDefaults and plist files. (Custom coding can still be provided as before to override the encoding format.)
Changed
- This release involves a substantial overhaul of how arrays and dictionaries are handled. (#8)
- Arrays and dictionaries with a homogenous value type (ie:
[Int],[String],[String: Int],[String: String]) remain directly usable in@Preftype declarations with less internal overhead now - Arrays and dictionaries with mixed value types (
[Any]or[String: Any]) are no longer usable directly with@Preftype declarations, and the type-erasure boxesAnyPrefsArrayandAnyPrefsDictionaryhave been removed from the library. Handling of mixed collections is now the responsibility of the user. See the updated README for more details.
- Arrays and dictionaries with a homogenous value type (ie:
1.2.0
New
- Added new built-in coding strategies (#3)
Boolstored asInt(1/0)Boolstored asString(true/false,yes/no, or custom strings)Data: stored as Base-64StringDatacompressionDatestored as ISO-8601StringBinaryIntegerstored asIntFixedWidthIntegerstored asStringURLstored as absolute URL string
- Pref declarations using a
RawRepresentabletype can now access.rawRepresentablePrefsCodingstatic property as an alternative to using@RawRepresentablePref. This allows chaining additional strategies.@Pref(coding: MyType.rawRepresentablePrefsCoding) var foo: MyType?
- Pref declarations using a
Codabletype can now access.jsonDataPrefsCodingor.jsonStringPrefsCodingstatic properties as an alternative to using@JSONDataCodablePrefor@JSONStringCodablePref. This allows chaining additional strategies.@Pref(coding: MyType.jsonDataPrefsCoding) var foo: MyType?
- Coding strategies can now be composed by chaining two or more strategies (#5)
@Pref(coding: MyType .jsonDataPrefsCoding .base64DataString() ) var foo: MyType?
Maintenance
- Updated README documentation