Skip to content

KoH1011/KTSnackBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KTSnackBar

CI Status Version License Platform

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.