- Renamed
OptionalType.empty
toOptionalType.__swifty_empty
. Also removed theOptionalType.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 publicOptionalType
in a future releases. @sunshinejr
- DefaultsAdapter's subscript setters are now
nonmutating
. This shouldn't change much on the client side, but it does fix the issue with simultaneous access (#241, #247). @sunshinejr - Added
DefaultsProviding
protocol thatDefaultsAdapter
implements. It should help with DI and creating test adapters (#268). @sunshinejr
- Increase min deployment target to iOS 9.0 due to Xcode 12 requirements @laevandus
- 🚀
- Removed Combine extensions for now. Due to problems with weak-linking the framework, it's too difficult to support it with ease using all package managers and also without breaking backwards-compatibility. Probably gonna introduce it once we only support Xcode 11. @sunshinejr
- Fixed an issue with Xcode freezing, never-finishing indexing/building the project when we used
Defaults[\.keyPath]
in conditional statement. Unfortunately we had to addkey
label toDefaults[key: DefaultsKey<String?>...]
where you wouldn't have to add the label to the subscript before. @sunshinejr
- Fixed an issue with SPM integration - it no longer fetches testing libraries & doesn't create runtime crashes or Xcode Preview crashes anymore. @sunshinejr
- Fixed an issue where Carthage users using Xcode 11 couldn't install SwiftyUserDefaults 5. We added weak-linking for the xcodeproj so you might need additional steps for Xcode 10 + Carthage + SwiftyUserDefaults 5.* users. @sunshinejr
- Added extensions for
Combine
! If you canimport Combine
and use it, check thepublisher(for:)
method onDefaultsAdapter
. @sunshinejr
- Introduced
DefaultsAdapter
thats the main object for user defaults and theDefaults
global variable. @marty-suzuki - Thanks to
DefaultsAdapter
, if you are using Swift 5.1 you can use dyanmic member lookup! This allows you to useDefaults.yourKey
instead ofDefaults[.yourKey]
. In case you are not using Swift 5.1, you would need to transition toDefaults[\.yourKey]
instead ofDefaults[.yourKey]
. @marty-suzuki - There is a new protocol,
DefaultsKeyStore
thatDefaultsKeys
conform to. This key store is then accepted by theDefaultsAdapter
so you can have multiple key stores for multiple adapters! @marty-suzuki - Unfortunately the above means that you need to declare your keys as a computed properties instead of static stored ones.@marty-suzuki
DefaultsBridge
is now a struct, not a class. You need to use composition instead of inheritance to compose them. @Z-JaDeDefaultsBridge
changed a little bit, there is noisSerialized
property anymore, if you create your own bridge you need to providedeserialize()
method as well. @Z-JaDe- Added
@SwiftyUserDefault
property wrapper for Swift 5.1 users! It uses key paths and has options to cache/observe your defaults as well. @sunshinejr - Updated project to recommended settings of Xcode 10.2. @philippec-ls
- Updated
DefaultsKey.defaultValue
access level topublic
. @DivineDominion - Updated accesslevel of all bridges to
open
frompublic
. @fredpi
- Regenerated the project as a potential fix to Carthage linking problems in beta 1. @sunshinejr
- Added support for launch arguments/plist for
Bool
,Double
,Int
,String
values. @sunshinejr - Added support for KVO! DivineDominion, toshi0383, @sunshinejr
- Brought back dictionary support for
[String: Any]
/[String: String]
and corresponding array version of it[[String: Any]]
/[[String: String]]
. @sunshinejr
- Fixed a non-optional vs optional comparison bug (#176). @z3bi and @sunshinejr
- Fixed an invalid Info.plist error (#173). @sunshinejr
- Swift 4.2 support. @sunshinejr
- Early Swift 5.0 support! @sunshinejr
- Rewritten core. We use
DefaultsBridges
now to define getters/setters for given type. @sunshinejr - Fixed a bug where you couldn't extend non-final class like
NSColor
. @sunshinejr - Removed type-based default values. This means you need to use key-based defaultValue or use an optional
DefaultsKey
from now on. @sunshinejr - Improved CI infra: Swift 4.1/4.2/5.0 builds with CocoaPods/Carthage/SPM integration scripts. @sunshinejr
- Swift 4.1 support @sunshinejr
- Added
Codable
support! @sunshinejr - Added generic subscripts support (better
DefaultsKey
init diagnostics and accessingDefaults[.key]
) @sunshinejr - Added default values protocols (
DefaultsDefaultValueType
,DefaultsDefaultArrayValueType
) - this means that you can extend any type with default value so you can create non-optionalDefaultsKey
afterwards! @sunshinejr - Added default values in
DefaultsKey
, e.g.DefaultsKey<String>("test", defaultValue: "default value")
@sunshinejr - Added better support for custom types: using
DefaultsSerializable
, when your type implementsNSCoding
,RawRepresentable
(enums as well) orCodable
, you get default implementations for free! @sunshinejr - Added automatic array support for any type that is available to
SwiftyUserDefaults
(means custom withDefaultsSerializable
as well!) @sunshinejr - Added Swift Package Manager support! @sunshinejr
- Added
[URL]
built-in support! @sunshinejr - A lot of infrastructure changes (CI, project), around 350 tests to make sure all of the changes work properly! @sunshinejr
- Removed legacy strings based API (
Defaults["test"]
),Dictionary
andAny
support (sorry, with all the changes in the library we had to, but you probably can bring it back withDefaultsSerializable
anyways 😅) @sunshinejr
- Fix for Swift Package Manager #114 @max-potapov
This is the Swift 3 update version.
It contains no major changes in the library itself, however it does change some APIs because of Swift 3 requirements.
- Update documentation and README for Swift 3
- Updated for Swift 3 and Xcode 8 compatibility #91 @askari01
- Updated for Swift 3 beta 4 #102 @rinatkhanov
- Updated for Swift 3 beta 6 #106 @ldiqual
NSUserDefaults.set()
is now public (useful for adding support for custom types) #85 @goktugyil- Support for Xcode 8 (Swift 2.3) for Carthage users #100 @KevinVitale
- Support for
archive()
andunarchive()
onRawRepresentable
types - Improved documentation
- Fix Carthage build
- Suppress deprecation warnings in tests
- Fixed infinite loop bug
- Added Travis CI integration
- Added Swift Package Manager support
- Documentation improvements
- Added
removeAll()
- Added tvOS and watchOS support
- Fixed error when linking SwiftyUserDefaults with app extension targets
- Minor tweaks and fixes
- Introducing statically-typed keys
- Define keys using
DefaultsKey
- Extend magic
DefaultsKeys
class to get access toDefaults[.foo]
shortcut - Support for all basic types, both in optional and non-optional forms
- Support for arrays of basic types, such as
[Double]
or[String]?
- Support for basic
[String: AnyObject]
dictionaries hasKey()
andremove()
for static keys- You can define support for static keys of custom
NSCoder
-compliant types - Support for
NSURL
in statically-typed keys
- Define keys using
- [Carthage] Added OS X support
Deprecations
+=
,++
,?=
operators are now deprecated in favor of statically-typed keys
- Added non-optional
Proxy
getters- string -> stringValue, etc.
- non-optional support for all except NSObject and NSDate getters
- Fixed Carthage (Set iOS Deployment target to 8.0)
- Converted tests to XCTest
- Carthage support
- Swift 1.2 compatibility
- Fixed podspec
- Initial release
Proxy
getters:- String, Int, Double, Bool
- NSArray, NSDictionary
- NSDate, NSData
- NSNumber, NSObject
- subscript setter
hasKey()
remove()
?=
,+=
,++
operators onProxy
- global
Defaults
shortcut