Simple, Customizable notification panel
- Swift 2.1
- Xcode 6
- iOS 8.0 or above
JKNotificationPanel is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "JKNotificationPanel"
Using JKNotification panel is very easy.
First of all you need to create JKNotifictionPanel
let panel = JKNotificationPanel()
panel.showNotify(withStatus: .SUCCESS, inView: self.view, message: "Success to upload all images.")
panel.showNotify(withStatus: .FAILED, belowNavigation: self.navigationController!)
let nib = UINib(nibName: "CustomNotificationView", bundle: NSBundle(forClass: self.dynamicType))
let customView = nib.instantiateWithOwner(nil, options: nil).first as! UIView
let width:CGFloat = UIScreen.mainScreen().bounds.size.width
customView.frame = CGRectMake(0, 0, width, 20)
panel.showNotify(withView: customView, belowNavigation: self.navigationController!)
panel.timeUntilDismiss = 0 // zero for wait forever
panel.enableTabDismiss = true
panel.showNotify(withStatus: .SUCCESS, belowNavigation: self.navigationController!, message: "Tap me to dissmiss")
func notificationPanelDidDismiss ()
func notificationPanelDidTab()
If you don't want to use delegate you can also use tab action instead.
panel.timeUntilDismiss = 0 // zero for wait forever
panel.enableTabDismiss = false
panel.addPanelDidTabAction() {
self.notificationPanelDidTab()
}
panel.showNotify(withStatus: .SUCCESS, belowNavigation: self.navigationController!, message: "Tab me to show alert")
Ter, http://www.macfeteria.com
JKNotificationPanel is available under the MIT license. See the LICENSE file for more info.