Commit Graph

37 Commits

Author SHA1 Message Date
Sindre Sorhus 7a22d37874 Add `.updates()` method
Fixes #77
2022-11-19 14:42:48 +07:00
Sindre Sorhus ea11b7ac4f Target macOS 10.15, iOS 13, tvOS 13, watchOS 6 2022-11-18 16:50:27 +07:00
hank121314 fbc67fd179
Support dynamic default value (#121)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2022-11-17 17:36:29 +07:00
Sindre Sorhus 176aa63666 Minor tweaks 2022-10-22 00:36:48 +07:00
Sindre Sorhus 001adc694b
Make `Defaults.AnyKey` conform to `Equatable` and `Hashable` (#104) 2022-06-04 19:08:34 +07:00
Sindre Sorhus c9198bb1d0
Add support for `UUID` (#92) 2022-01-27 22:14:21 +07:00
Sindre Sorhus 4a0f5e7c3e Clean up some docs 2021-05-17 00:16:21 +07:00
hank121314 534157f1b5 Add a `Defaults.Serializable` protocol (#57)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2021-05-16 23:52:46 +07:00
OCJvanDijk 6158b9bdb3
Fix crash in `.publisher()` caused by immediately cancelling subscriber (#66) 2021-04-18 23:45:37 +07:00
iurii iaremenko 760dbfb077
Support `.removeDuplicates()` for `Defaults.publisher` (#60)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2021-02-20 20:29:15 +07:00
Sindre Sorhus 030c70a55e Move to GitHub Actions 2021-01-25 00:08:31 +07:00
Sindre Sorhus 110f2d2b9e Various improvements 2020-08-28 23:09:19 +02:00
Kacper Rączy ab8127604c
Add ability to subscribe to multiple keys and to prevent propagation (#49)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2020-08-28 22:12:29 +02:00
Sindre Sorhus c9033c70cf Minor tweaks 2020-06-21 20:23:41 +08:00
Sindre Sorhus 5df16e0d2e Remove `Defaults.publisherAll` until #42 is fixed 2020-04-18 14:21:31 +08:00
Sindre Sorhus c20b7d820c Fix `Defaults.publisher(keys:)` 2020-04-18 14:19:38 +08:00
Sindre Sorhus 15c096d7fd Fix `Defaults.reset()` 2020-04-18 14:16:02 +08:00
Sindre Sorhus 8376ca7f51 Remove the `.old` and `.new` options
They are now `true` by default.

Fixes #33
2020-04-13 13:15:13 +08:00
Sindre Sorhus 31b56ce018 Rename `DefaultsObservation` to `Defaults.Observation` 2020-04-13 12:31:54 +08:00
Sindre Sorhus b2fdee2055 Get rid of `OptionalKey` 2020-04-13 12:25:18 +08:00
Kacper Rączy 3275717838
Fix crash in the Combine API (#39) 2020-04-05 22:56:59 +08:00
Sindre Sorhus ca813bf449 Meta tweaks 2020-01-21 00:11:19 +07:00
Kacper Rączy 6029ac796b Combine support (#31)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2020-01-20 23:41:13 +07:00
Sindre Sorhus a82d6728e7 Fix availability checks for CocoaPods 2019-10-30 19:47:54 +07:00
Koray Koska 89d2d4d353 Add support for NSSecureCoding (#27)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2019-10-30 18:57:31 +07:00
Ian Gregory 54f970b9d7 Add `DefaultsObsevation.tieToLifetime(of:)` (#13)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2019-10-30 18:50:24 +07:00
Sindre Sorhus eeb8c73d7f Docs improvements 2019-09-11 14:59:40 +07:00
Sindre Sorhus 27c9997134 Rename `Defaults.clear` to `Defaults.removeAll` 2019-09-11 14:35:17 +07:00
Sindre Sorhus 90ac6f8802 Switch to static subscript on `Defaults` 2019-09-11 14:27:52 +07:00
Robert Hahn d1e42154f9 Add `.reset()` method to reset given keys back to their default value (#22)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2019-09-11 14:12:41 +07:00
Sindre Sorhus 674fde4974 Fix the source file location for SwiftPM
Closes #20
Fixes #19
2019-07-25 08:53:47 +07:00
Sindre Sorhus 257ce0df90
Add support for key observation and other improvements (#10)
And some other improvements:
- Shorter syntax for defining keys.
- It now writes the default value of `Defaults.Key` back to the actual UserDefaults on creation.
- Support alternative UserDefaults suites.
- Improved docs and test coverage.
2018-10-17 17:22:10 +07:00
Sindre Sorhus 0f45f544d6 Correctly set `nil` for `OptionalKey`
Fixes #8
2018-05-14 15:27:35 +07:00
Sindre Sorhus 7868e47910 Add support for iOS, tvOS, watchOS
Fixes #1
2018-04-16 16:50:36 +07:00
Lars-Jørgen Kristiansen 3dffe718a2 Fix access level for init and other tweaks
Fixes #6
2018-04-16 16:00:36 +07:00
Lars-Jørgen Kristiansen 3b7f63bc90 Use native data coding (#5) 2018-04-16 01:09:53 +07:00
Sindre Sorhus c78c1b00b6 Init 2018-04-12 01:06:24 +07:00