Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
c-villain authored Jan 6, 2023
1 parent 5dce44f commit 7bb1047
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,48 @@ The result:

</details>

<details>
<summary>in group of views</summary>

Use can use `.animate(...)` not only for one view but for group of views

```swift
@State var animate: Bool = false
...
Button {
animate.toggle()
} label: {
HStack(spacing: 8) {
Image(systemName: animate ? "heart.fill" : "heart")
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
.foregroundColor(.red)
Text("Like")
.font(.body)
.fontWeight(.medium)
.foregroundColor(.red)
}
.animate(.liveComments(stamps: 4), // <== Look here!
animate: animate)
.padding(12)
.background(
Rectangle()
.fill(.blue.opacity(0.8))
.cornerRadius(12)
)
}
```

The result:

<p align="left">
<img src="Gifs/example1.gif" alt="example1">
</p>

</details>

## Communication

- If you **found a bug**, open an issue or submit a fix via a pull request.
Expand Down

0 comments on commit 7bb1047

Please sign in to comment.