Update readme.md

This commit is contained in:
Sindre Sorhus 2022-11-17 17:29:19 +07:00 committed by GitHub
parent eeed6968a6
commit a793470418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -123,8 +123,7 @@ if let name = Defaults[.name] {
The default value is then `nil`.
Sometimes you cannot define a static default value as it may change during the lifetime of the app.
`Defaults.Key` also support dynamic default value.
You can also specify a dynamic default value. This can be useful when the default value may change during the lifetime of the app:
```swift
extension Defaults.Keys {
@ -393,7 +392,7 @@ print(UserDefaults.standard.bool(forKey: Defaults.Keys.isUnicornMode.name))
```
> **Note**
> `Defaults.Key` with dynamic default value will not register the `default` value in `UserDefaults`.
> A `Defaults.Key` with a dynamic default value will not register the default value in `UserDefaults`.
## API