Latest 1.0
Homepage https://github.com/Serheo/ToastMessage
License MIT
Platforms ios 9.0, requires ARC
Authors

Toast Message

Build
Swift
CocoaPods Compatible
Carthage compatible

Toast Messages for iOS 9.0 and higher.
Features:

  • All toasts are enqueued. One toast per time
  • Customizable fonts, colors, duration and position of the message
  • Different styles – Toast and notitication
  • Toasts are automatically rotated

Installation

Carthage

github "Serheo/ToastMessage"

CocoaPods

pod 'ToastMessage'

Getting Started

  • Import

    import ToastMessage
  • Show regular toast message

    ToastManager.shared.showToastMessage(msg: "Toast Message")
  • Show toast message with custom duration and location

    ToastManager.shared.showToast(message: "Show second message",
                                             duration: 3.0,
                                             location: ToastViewLocation.bottomSpace(margin: 80))
  • Show toast message with custom style
    struct ToastCustomStyle: ToastViewStyle {
    let backgroundColor: UIColor = UIColor.yellow
    let textColor: UIColor = UIColor.black
    let font: UIFont = UIFont.boldSystemFont(ofSize: 22)
    }
    ToastManager.shared.showToast(message: "Custom Message",
                                            duration: 2.0,
                                            location: ToastViewLocation.top,
                                            style: ToastCustomStyle())

See how is looks or try it in the Demo app.

  • Show regular notitication message

    ToastManager.shared.showNotification(message: "Top Message")
  • Show notitication message with custom style

    struct NotificationCustomStyle: ToastViewStyle {
    let backgroundColor: UIColor = UIColor.orange
    let textColor: UIColor = UIColor.black
    let font: UIFont = UIFont.systemFont(ofSize: 16.0)
    }
    ToastManager.shared.showNotification(message: "Custom Message",
                                      duration: 2.0,
                                      style: NotificationCustomStyle())
  • Remove all toasts from the queue
    ToastManager.shared.cancelAll()

Requirements

iOS 9+
Swift

License

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

Latest podspec

{
    "name": "ToastMessage",
    "version": "1.0",
    "summary": "Toast messages for iOS",
    "homepage": "https://github.com/Serheo/ToastMessage",
    "license": "MIT",
    "authors": {
        "Serheo Shatunov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Serheo/ToastMessage.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "ToastMessage/Sources/**/*.{swift}",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This