Aamirali86 / iToast

Android-like toast with very simple interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iToast

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Features

  • Queueing: Centralized toast center manages the toast queue.
  • Customizable: See the Appearance section.
  • Positionable: Set the toast position to center, top or bottom

Usage


import SmartToast

// basic usage
ToastManager.shared.showToast("Hello world")

// toast with a specific duration and position
ToastManager.shared.showToast("Hello world", duration: ToastManager.LENGHT_LONG, position: .top)

// toast with customized appearance
var style = ToastStyle()
style.backgroundColor = UIColor.red.withAlphaComponent(0.8)
ToastManager.shared.showToast("Hello world", style:style)

Installation

SmartToast is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SmartToast'

Appearance

Supported appearance properties are:

Property Type Description
backgroundColor UIColor Background color of toast
cornerRadius CGFloat Corner radius
shadowOpacity Float Toast shadow opacity
shadowColor UIColor Shadow color
shadowOffset CGSize Shadow offset
shadowRadius CGFloat Shadow radius
textColor UIColor Toast message color

Demo

Screenshot

Author

Muhammad Aamir, aamir-muhammad@hotmail.com

License

SmartToast is available under the MIT license. See the LICENSE file for more info.

About

Android-like toast with very simple interface.

License:MIT License


Languages

Language:Swift 90.2%Language:Ruby 9.8%