Skip to content
🍞 An async waiting toast with basic toast. Inspired by facebook posting toast
Branch: master
Clone or download
Latest commit 931bd44 May 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AwaitToast.xcodeproj Update support to Swift 5 May 9, 2019
Example Update Example Apr 3, 2019
Sources/AwaitToast Fix height when iphone x series May 9, 2019
.gitignore Initial commit Mar 6, 2019
.swift-version Initial commit Mar 6, 2019
.travis.yml Add .travis.yml May 9, 2019
AwaitToast.h Initial commit Mar 6, 2019
AwaitToast.podspec Bump version to 1.2.0 May 9, 2019
Info.plist Bump version to 1.2.0 May 9, 2019
LICENSE Initial commit Mar 6, 2019
README.md Update README.md May 9, 2019

README.md

AwaitToast

Build Status Swift Cocoapods Carthage compatible

🍞 An async waiting toast with basic toast. Inspired by facebook posting toast.

Introduction

Usage

Default

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

let awaitToast: AwaitToast = AwaitToast.default(initialText: "Toast is started", endText: "Toast is ended")

// Show
awaitToast.show()

// Finish
awaitToast.finish()

// Dismiss
awaitToast.dismiss()

Dismiss

// Last toast in queue dismiss
Toast.latestDismiss()
AwaitToast.latestDismiss()

// All toast in queue dismiss
Toast.dismissAll()
AwaitToast.dismissAll()

Appearance

// 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

// 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

ToastAppearanceManager.default.height = AutomaticDimension
ToastAppearanceManager.icon.height = AutomaticDimension

Installation

CocoaPods (iOS 9+)

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'AwaitToast'
end

Carthage (iOS 9+)

github "k-lpmg/AwaitToast"

LICENSE

These works are available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.