Latest 1.0.0
Homepage https://github.com/KoH1011/KTSnackBar
License MIT
Platforms ios 9.0, requires ARC
Authors

CI Status
Version
License
Platform

KTSnackBar

Usage

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

Simple

self.snackBar = KTSnackBar()
self.snackBar.show(buttonText: "Tap Dissmiss!")
self.setupEnabled(for: false)
self.snackBar.pressedBlock = {
  print("Dismiss!")
}

Custom

let view = UIView()
view.backgroundColor = UIColor.red
view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 20)
let option = [
    .height(20)
    ] as [KTSnackBarOption]
self.snackBar = KTSnackBar(options: option, showHandler: {
    print("custom show")
}) {
    print("custom dismiss")
}
snackBar.show(aView: view)

Requirements

  • iOS 9.0+
  • Swift 4

Installation

CocoaPods (iOS 9+)

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

use_frameworks!
pod "KTSnackBar"

Carthage (iOS 9+)

You can use Carthage to install KTSnackBar by adding it to your Cartfile:

github "KoH1011/KTSnackBar"

Manual Installation

The class file required for Popover is located in the Classes folder in the root of this repository as listed below:

KTSnackBar.swift

Customization

Enum

  • case width(CGFloat)
  • case height(CGFloat)
  • case font(UIFont)
  • case interval(Double)

License

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

Latest podspec

{
    "name": "KTSnackBar",
    "version": "1.0.0",
    "summary": "KTSnackBar is a pop up library like Android AppWidget. It is written in pure swift",
    "homepage": "https://github.com/KoH1011/KTSnackBar",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "KoH1011": "[email protected]"
    },
    "source": {
        "git": "https://github.com/KoH1011/KTSnackBar.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/KoH_1011",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "KTSnackBar/*.swift",
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    }
}

Pin It on Pinterest

Share This