All Versions
Latest Version
Avg Release Cycle
79 days
Latest Release
886 days ago

Changelog History
Page 1

  • v4.1.0 Changes

    August 28, 2020
    • โž• Add ability to subscribe to multiple keys ab81276
    • โž• Add ability to prevent event propagation ab81276

    0๏ธโƒฃ v4.0.0...v4.1.0

  • v4.0.0 Changes

    April 18, 2020

    ๐Ÿ’ฅ Breaking

    • 0๏ธโƒฃ Get rid of Defaults.OptionalKeyb2fdee2

      • Migrate:

      extension Defaults.Keys {- static let name = OptionalKey<Double>("name")+ static let name = Key<Double?>("name") }

    • โœ‚ Remove the .old and .new options for Defaults.observe 8376ca7

      • They're now the default. There was no good reason to not specify them and it was easy to leave them out by accident and then getting the incorrect .newValue/.oldValue.
    • 0๏ธโƒฃ Rename DefaultsObservation to Defaults.Observation 31b56ce

    ๐Ÿ‘Œ Improvements

    ๐Ÿ›  Fixes

    • 0๏ธโƒฃ Defaults.reset() now works with keys of different types, but it's limited to 10 keys because of Swift generics limitations 15c096d

    0๏ธโƒฃ v3.1.1...v4.0.0

  • v3.1.1 Changes

    October 30, 2019
    • ๐Ÿ›  Fix availability checks for CocoaPods a82d672
  • v3.1.0 Changes

    October 30, 2019
  • v3.0.0 Changes

    September 11, 2019

    ๐Ÿ’ฅ Breaking

    • ๐Ÿ— Require Xcode 11 and Swift 5.1 for building 90ac6f8
    • 0๏ธโƒฃ Switch from defaults to Defaults 90ac6f8
      0๏ธโƒฃ Example: defaults[.unicorn] โ†’ Defaults[.unicorn]
      0๏ธโƒฃ Example: defaults.observable โ†’ Defaults.observable
    • ๐Ÿšš Rename defaults.clear to Defaults.removeAll and make it a static method 27c9997

    โœจ Enhancements

    • โž• Add .reset() method to reset the given keys back to their default value d1e4215
  • v2.0.2 Changes

    July 25, 2019
    • ๐Ÿ›  Fix the source file location for SwiftPM 674fde4
  • v2.0.1 Changes

    July 08, 2019
    • ๐Ÿ›  Fix Swift 5 upgrade warning 865a4b0
  • v2.0.0 Changes

    April 05, 2019
    • โฌ†๏ธ Upgrade to and require Swift 5. 908d3b4
  • v1.0.0 Changes

    October 17, 2018

    Key observation

    You can now observe changes to keys in a strongly-typed fashion. It even preserves the type of the oldValue and newValue keys in the change event.

    extension Defaults.Keys { static let isUnicornMode = Key\<Bool\>("isUnicornMode", default: false) }let observer = defaults.observe(.isUnicornMode) { change in// Initial eventprint(change.oldValue) //=\> falseprint(change.newValue) //=\> false// First actual eventprint(change.oldValue) //=\> falseprint(change.newValue) //=\> true} defaults[.isUnicornMode] = true

    Shorter syntax

     extension Defaults.Keys {- static let quality = Defaults.Key\<Double\>("quality", default: 0.8)+ static let quality = Key\<Double\>("quality", default: 0.8) }

    ๐Ÿ‘Œ Support for alternative UserDefaults suites

    let extensionDefaults = UserDefaults(suiteName: "")!extension Defaults.Keys { static let isUnicorn = Key\<Bool\>("isUnicorn", default: true, suite: extensionDefaults) } defaults[.isUnicorn]//=\> true// OrextensionDefaults[.isUnicorn]//=\> true

    0๏ธโƒฃ Registers default values with the native UserDefaults

    When you use, for example:

    extension Defaults.Keys { static let quality = Key\<Double\>("quality", default: 0.8) }

    ๐Ÿ— It will register 0.8 as the default value with UserDefaults, which can then be used in other contexts, like binding in Interface Builder.

  • v0.2.2

    June 19, 2018