π An async waiting toast with basic toast. Inspired by facebook posting toast.
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)
let awaitToast: AwaitToast = AwaitToast.default(initialText: "Toast is started", endText: "Toast is ended")
// Show
awaitToast.show()
// Finish
awaitToast.finish()
// Dismiss
awaitToast.dismiss()
// Last toast in queue dismiss
Toast.latestDismiss()
AwaitToast.latestDismiss()
// All toast in queue dismiss
Toast.dismissAll()
AwaitToast.dismissAll()
// 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
...
// 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
...
ToastAppearanceManager.default.height = AutomaticDimension
ToastAppearanceManager.icon.height = AutomaticDimension
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AwaitToast'
end
github "k-lpmg/AwaitToast"
These works are available under the MIT license. See the LICENSE file for more info.