To run the example project, clone the repo, and run pod install
from the Example directory first.
self.snackBar = KTSnackBar()
self.snackBar.show(buttonText: "Tap Dissmiss!")
self.setupEnabled(for: false)
self.snackBar.pressedBlock = {
print("Dismiss!")
}
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)
- iOS 9.0+
- Swift 4
KTSnackBar is available through CocoaPods. To install
it, simply add the following line to your Podfile
:
use_frameworks!
pod "KTSnackBar"
You can use Carthage to install KTSnackBar
by adding it to your Cartfile
:
github "KoH1011/KTSnackBar"
The class file required for Popover is located in the Classes folder in the root of this repository as listed below:
KTSnackBar.swift
case width(CGFloat)
case height(CGFloat)
case font(UIFont)
case interval(Double)
KTSnackBar is available under the MIT license. See the LICENSE file for more info.