Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 days 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 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-11T17:00:32.000Z (over 5 years ago)
- Last Synced: 2024-10-14T22:20:46.556Z (about 1 month ago)
- Topics: ios, swift, toast, toast-message
- Language: Swift
- Homepage:
- Size: 58.6 KB
- Stars: 144
- Watchers: 5
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AwaitToast
[![Build Status](https://travis-ci.org/k-lpmg/AwaitToast.svg?branch=master)](https://travis-ci.org/k-lpmg/AwaitToast)
![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)
[![Cocoapods](https://img.shields.io/cocoapods/v/AwaitToast.svg?style=flat)](https://cocoapods.org/pods/AwaitToast)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](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