Skip to content

Commit

Permalink
Add 'Removing Toasts' section to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
devxoul committed Apr 11, 2016
1 parent 5043705 commit 8bd9a6f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,32 @@ JLToast.makeText("Some text", delay: 1, duration: JLToastDelay.ShortDelay)
```


Removing Toasts
---------------

- **Removing toast with reference**:

```swift
let toast = JLToast.makeText("Hello")
toast.show()
toast.cancel() // remove toast immediately
```

- **Removing current toast**:

```swift
if let currentToast = JLToastCenter.defaultCenter.currentToast {
currentToast.cancel()
}
```

- **Removing all toasts**:

```swift
JLToastCenter.defaultCenter.cancelAllToasts()
```


Appearance
----------

Expand Down

0 comments on commit 8bd9a6f

Please sign in to comment.