Latest 0.1.1
Homepage https://github.com/lohmander/SimpleToast
License MIT
Platforms ios 8.0, requires ARC
Authors

Provides Android-like API for displaying toasts with keyboard aware positioning on iOS.

Toast

Installation

Through CocoaPods:

pod 'SimpleToast', '~> 0.1.1'

Usage

First you need to initialize the keyboard observer somewhere. It doesn’t really matter where.

import SimpleToast

...

Toast.initKeyboardObserver()

...

Then use just use it as follows (with the library imported):

Toast.makeText("My toast message", Toast.LENGTH_LONG).show()

Settings

There’s a few appearance settings you can adjust:

blur: Bool

Right there’s no background at all if you turn this of. To be fixed…

blurStyle: UIBlurEffectStyle

cornerRadius: CGFloat

margin: CGFloat

Margin to parent view (ie. the window)

padding: CGFloat

Padding between the background view and the text label.

textColor: UIColor

animationDuration: NSTimeInterval

Example:

Set the values like so:

Toast.appearance.cornerRadius = 2

License

MIT Licensed

Latest podspec

{
    "name": "SimpleToast",
    "version": "0.1.1",
    "license": "MIT",
    "summary": "Simple toasts with Android-like API and keyboard aware positioning.",
    "homepage": "https://github.com/lohmander/SimpleToast",
    "authors": {
        "Hannes Lohmander": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lohmander/SimpleToast.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Toast/Toast/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This