Latest 0.0.2
Homepage https://github.com/tattn/SwiftyToast
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, Foundation, QuartzCore
Authors

CocoaPods Status
License

A simple toast library written by Swift


TTToast

Installation

Carthage

github "tattn/SwiftyToast"

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

platform :ios, '8.0'
pod 'SwiftyToast'

Manually

Add manually:

  1. Add SwiftyToast.swift to your project.
  2. Link QuartzCore.

Examples

// simple
SwiftyToast.show("Hello worldnToast test")

// customization
SwiftyToast.show("Hello worldnToast test", view:self.view) { config in
    // appearance
    config.maxWidth = 0.8
    config.paddingHorizontal = 10.0
    config.paddingVertical = 10.0
    config.cornerRadius = 8
    config.alpha = 0.5
    config.font = UIFont(name: "SnellRoundhand", size: 25.0)
    config.textColor = UIColor(red: 0.192, green: 0.216, blue: 0.082, alpha: 1.0)
    config.backgroundColor = UIColor(red: 0.886, green: 0.976, blue: 0.72, alpha: 1.0)
    // shadow
    config.shadow = true
    config.shadowOpacity = 0.5
    config.shadowRadius = 10.0
    config.shadowOffset = CGSize(width: 4.0, height: 4.0)
    config.shadowColor = UIColor(red: 0.576, green: 0.624, blue: 0.36, alpha: 1.0).cgColor
    // duration
    config.durationBefore = 1.0
    config.duration = 2.0
    config.durationAfter = 0.5
    // position
    config.position = SwiftyToast.Position.bottom.rawValue | SwiftyToast.Position.right.rawValue
}

// global settings
SwiftyToast.config.backgroundColor = .black
SwiftyToast.config.textColor = .white

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

SwiftyToast is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "SwiftyToast",
    "version": "0.0.2",
    "summary": "This is a simple toast library.",
    "homepage": "https://github.com/tattn/SwiftyToast",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Tatsuya Tanaka": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/tattn/SwiftyToast.git",
        "tag": "v0.0.2"
    },
    "source_files": "SwiftyToast/SwiftyToast/*.{swift,h}",
    "exclude_files": "Classes/Exclude",
    "public_header_files": "SwiftyToast/SwiftyToast/SwiftyToast.h",
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This