OptionalType.empty
to OptionalType.__swifty_empty
. Also removed the OptionalType.wrapped
since it wasn't used in the framework anymore. Please note that this still shouldn't be something you rely on tho, we're gonna explore ways to remove the public OptionalType
in a future releases. @sunshinejr
Published by sunshinejr over 3 years ago
nonmutating
. This shouldn't change much on the client side, but it does fix the issue with simultaneous access (#241, #247). @sunshinejr
DefaultsProviding
protocol that DefaultsAdapter
implements. It should help with DI and creating test adapters (#268). @sunshinejr
Published by sunshinejr over 3 years ago
This version only increases the minimum requirements for iOS to make it compatible with Xcode 12. Redone since we didn't bump podspec version for CocoaPods support.
Published by sunshinejr almost 5 years ago
Finally version 5.0.0 is ready to go! After extensive testing we are releasing this version to the public. 🚀
Very warm thank you to everyone participating in all these months of work: @marty-suzuki, @Z-JaDe, @philippec-ls and others that contributed to this project. On to the next year! 🥂
Note: There shouldn't be any differences between latest beta and this version so you should be ready to go with bumping the version in your favorite dependency manager. If you are migrating from version 4 and lower, please check our migration guides.
Published by sunshinejr about 5 years ago
Unfortunately we had to remove Combine for now to keep Xcode 10 compatibility 😭 You might want to update to that version ASAP as it's fixing crashes on release builds...
Published by sunshinejr about 5 years ago
Fixed a pretty bad indexing/building issue... See Migration Guide for more.
Defaults[\.keyPath]
in conditional statement. Unfortunately we had to add key
label to Defaults[key: DefaultsKey<String?>...]
where you wouldn't have to add the label to the subscript before. @sunshinejr.Published by sunshinejr about 5 years ago
Fixes to package managers! 🚀 Xcode 11 & Carthage are friends again. Also, you won't fetch testing libraries for SPM anymore so you can use your Xcode Previews again.
Published by sunshinejr about 5 years ago
This beta adds Combine support! Just use it on the DefaultsAdapter
(if you can use Combine
):
func obserColorScheme() {
colorSchemeObserver = Defaults.publisher(for: \.colorSchemeObserver)
.sink { value in
//
}
}
Published by sunshinejr about 5 years ago
This cool release prepares for Swift 5.1 - we introduce key path access (enabling dynamicMemberLookup
) and property wrapper! Additionally there are some changes to all Defaults
global variable, DefaultsKeys
and `DefaultsBridge - check out our migration guide for more.
DefaultsAdapter
thats the main object for user defaults and the Defaults
global variable. @marty-suzuki
DefaultsAdapter
, if you are using Swift 5.1 you can use dyanmic member lookup! This allows you to useDefaults.yourKey
instead of Defaults[.yourKey]
. In case you are not using Swift 5.1, you would need to transition to Defaults[\.yourKey]
instead of Defaults[.yourKey]
. @marty-suzuki
DefaultsKeyStore
that DefaultsKeys
conform to. This key store is then accepted by the DefaultsAdapter
so you can have multiple key stores for multiple adapters! @marty-suzuki
DefaultsBridge
is now a struct, not a class. You need to use composition instead of inheritance to compose them. @Z-JaDe
DefaultsBridge
changed a little bit, there is no isSerialized
property anymore, if you create your own bridge you need to provide deserialize()
method as well. @Z-JaDe
@SwiftyUserDefault
property wrapper for Swift 5.1 users! It uses key paths and has options to cache/observe your defaults as well. @sunshinejr
Published by sunshinejr over 5 years ago
4.0.0 is finally out. A lot of cool features and improvements for you to try today! 🚀
DefaultsKey.defaultValue
access level to public
. @DivineDominion
open
from public
. @fredpi
Published by sunshinejr over 5 years ago
Minor stability update for Carthage users. This should fix the linking problem we've had in beta.1.
No other fixes/updates were introduced in here.
Published by sunshinejr over 5 years ago
This update introduces few cool additions to the library! 🎉
Bool
, Double
, Int
, String
values. @sunshinejr
[String: Any]
/[String: String]
and corresponding array version of it [[String: Any]]
/[[String: String]]
. @sunshinejr
If you have already created a custom bridge for you type, and you want to use it with KVO, you'll need to override two new functions: isSerialized()
and deserialize(_:)
. See Readme for more instructions.
Published by sunshinejr over 5 years ago
This is a small update over 4.0.0-alpha.2 with two fixes.
Migration guide from 3.x to 4.x
Migration guide from 4.0.0-alpha.1 to 4.0.0-alpha.2
Published by sunshinejr over 5 years ago
🎉🎉🎉
We're back with alpha 2!
Migration guide from 3.x to 4.x
Migration guide from 4.0.0-alpha.1 to 4.0.0-alpha.2
DefaultsBridges
now to define getters/setters for given type. @sunshinejr
NSColor
. @sunshinejr
DefaultsKey
from now on. @sunshinejr
Published by sunshinejr over 6 years ago
🎉🎉🎉
This is a huge release. Please try it out and let me know how it feels as we still have time for improvements!
Migration guide from 3.x to 4.x
Codable
support! @sunshinejr
DefaultsKey
init diagnostics and accessing Defaults[.key]
) @sunshinejr
DefaultsDefaultValueType
, DefaultsDefaultArrayValueType
) - this means that you can extend any type with default value so you can create non-optional DefaultsKey
afterwards! @sunshinejr
DefaultsKey
, e.g. DefaultsKey<String>("test", defaultValue: "default value")
@sunshinejr
DefaultsSerializable
, when your type implements NSCoding
, RawRepresentable
(enums as well) or Codable
, you get default implementations for free! @sunshinejr
SwiftyUserDefaults
(means custom with DefaultsSerializable
as well!) @sunshinejr
[URL]
built-in support! @sunshinejr
Defaults["test"]
), Dictionary
and Any
support (sorry, with all the changes in the library we had to, but you probably can bring it back with DefaultsSerializable
anyways 😅) @sunshinejr