Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bring-shrubbery authored Apr 28, 2022
1 parent 4de2b08 commit 917c41c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ Text("Say something nice...")

![example 1](images/example_1.jpg)

### Controlling whether the tooltip is present

You can cantrol whether the tooltip is presented or not through the `_ enabled: Binding<Bool>` argument. Below you can see an example of how this would look like.

```swift
@State var tooltipVisible = false
...
Button("Toggle tooltip") {
self.tooltipVisible = !self.tooltipVisible
}
...
Text("I'm the confusing text.")
.tooltip(self.tooltipVisible) {
Text("I'm the text explaining the confusing text.")
}
```

### Using custom configuration to add a jumping animation

Second example shows you how you can add jumping animation to the tooltip from the first example.
Expand Down

0 comments on commit 917c41c

Please sign in to comment.