Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus authored Sep 25, 2024
1 parent 147892d commit 8708fd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ You cannot use `@Default` in an `ObservableObject`. It's meant to be used in a `

#### `@Default` in `@Observable`

With the `@Default` macro, you can use `Defaults` inside `@Observable` classes that use the [Observation](https://developer.apple.com/documentation/observation) framework. Doing so is as simple as importing `DefaultsMacros` as adding two lines to a property (note that adding `@ObservationIgnored` is needed to prevent clashes with `@Observable`):
With the `@Default` macro, you can use `Defaults` inside `@Observable` classes that use the [Observation](https://developer.apple.com/documentation/observation) framework. Doing so is as simple as importing `DefaultsMacros` and adding two lines to a property (note that adding `@ObservationIgnored` is needed to prevent clashes with `@Observable`):

```swift
import Defaults
import DefailtsMacros
import DefaultsMacros

@Observable
final class UnicornManager {
Expand Down

0 comments on commit 8708fd5

Please sign in to comment.