https://github.com/k-lpmg/AwaitToast
🍞 An async waiting toast with basic toast. Inspired by facebook posting toast
https://github.com/k-lpmg/AwaitToast
ios swift toast toast-message
Last synced: 8 months ago
JSON representation
🍞 An async waiting toast with basic toast. Inspired by facebook posting toast
- Host: GitHub
- URL: https://github.com/k-lpmg/AwaitToast
- Owner: k-lpmg
- License: mit
- Created: 2019-03-06T15:50:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-11T17:00:32.000Z (over 6 years ago)
- Last Synced: 2025-03-10T14:55:25.367Z (8 months ago)
- Topics: ios, swift, toast, toast-message
- Language: Swift
- Homepage:
- Size: 58.6 KB
- Stars: 145
- Watchers: 4
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - AwaitToast - 🍞 An async waiting toast with basic toast. Inspired by facebook posting toast. (Libs / UI)
- awesome-swift - AwaitToast - An async waiting toast with basic toast. Inspired by facebook posting toast ` 📝 2 years ago` (UI [🔝](#readme))
- awesome-swift - AwaitToast - 🍞 An async waiting toast with basic toast. Inspired by facebook posting toast. (Libs / UI)
- awesome-swift - AwaitToast - 🍞 An async waiting toast with basic toast. Inspired by facebook posting toast. (Libs / UI)
README
# AwaitToast
[](https://travis-ci.org/k-lpmg/AwaitToast)

[](https://cocoapods.org/pods/AwaitToast)
[](https://github.com/Carthage/Carthage)
🍞 An async waiting toast with basic toast. Inspired by facebook posting toast.
## Introduction
## Usage
#### Default
```swift
let toast: Toast = Toast.default(text: "Toast is started")
// Show
toast.show()
// Dismiss
toast.dismiss()
// Bottom Direction
Toast.default(text: "Toast is started", direction: .bottom)
```
#### Await
```swift
let awaitToast: AwaitToast = AwaitToast.default(initialText: "Toast is started", endText: "Toast is ended")
// Show
awaitToast.show()
// Finish
awaitToast.finish()
// Dismiss
awaitToast.dismiss()
```
#### Dismiss
```swift
// Last toast in queue dismiss
Toast.latestDismiss()
AwaitToast.latestDismiss()
// All toast in queue dismiss
Toast.dismissAll()
AwaitToast.dismissAll()
```
#### Appearance
```swift
// Get singleton appearance object
let defaultAppearance = ToastAppearanceManager.default
let iconAppearance = ToastAppearanceManager.icon
// Update singletone appearance properties
defaultAppearance.height = 128
defaultAppearance.backgroundColor = .white
defaultAppearance.numberOfLines = 1
defaultAppearance.textAlignment = .left
...
```
#### Behavior
```swift
// Get singleton behavior object
let defaultBehavior = ToastBehaviorManager.default
let awaitBehavior = ToastBehaviorManager.await
// Update singletone behavior properties
defaultBehavior.isTappedDismissEnabled = false
defaultBehavior.delay = 3.0
defaultBehavior.showDurarion = 0.3
defaultBehavior.duration = 3.0
defaultBehavior.dismissDuration = 0.3
...
```
#### Self-sizing

```swift
ToastAppearanceManager.default.height = AutomaticDimension
ToastAppearanceManager.icon.height = AutomaticDimension
```
## Installation
#### CocoaPods (iOS 9+)
```ruby
platform :ios, '9.0'
use_frameworks!
target '' do
pod 'AwaitToast'
end
```
#### Carthage (iOS 9+)
```ruby
github "k-lpmg/AwaitToast"
```
## LICENSE
These works are available under the MIT license. See the [LICENSE][license] file
for more info.
[license]: LICENSE