jkn

JKNotificationPanel

JKNotificationPanel lets you create a simple notification panel that display on the top of the view/navigation or below.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

40

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

JKNotificationPanel

Version License Platform

Simple, Customizable notification panel,

JKNotificationPanel

Requirements

  • Swift 3 ( Swift 2.3 use version 0.2 )
  • Xcode 6
  • iOS 8.0 or above

Installation

JKNotificationPanel is available through CocoaPods and Carthage.

POD

To install it, simply add the following line to your Podfile:

use_frameworks!
pod "JKNotificationPanel"

JKNotificationPanel written in Swift, you must explicitly include use_frameworks! to your Podfile or target to opt into using frameworks.

Carthage

Create a Cartfile in your project directory and add the following line.

github "macfeteria/JKNotificationPanel"

Run carthage update This will build the framework. The framework will be within Carthage/build/JKNotificationPanel.framework.

Usage

Using JKNotification panel is very easy.

Basic Usage

First of all you need to create JKNotifictionPanel

let panel = JKNotificationPanel()

Displaying the basic panel

panel.showNotify(withStatus: .success, inView: self.view, title: "Success to upload all images.")

Displaying the panel below the navigation

panel.showNotify(withStatus: .warning, belowNavigation: self.navigationController!)

Subtitle View

panel.showNotify(withStatus: .warning, belowNavigation: self.navigationController!, title: "Chelsea Football Club", message: "Chelsea 4 - 2 Leicester")

Custom View

let nib = UINib(nibName: "CustomNotificationView", bundle: Bundle(for: type(of: self)))
let customView  = nib.instantiate(withOwner: nil, options: nil).first as! UIView
let width:CGFloat = UIScreen.main.bounds.size.width
customView.frame = CGRect(x: 0, y: 0, width: width, height: 42)
panel.showNotify(withView: customView, belowNavigation: self.navigationController!)

Tap to dismiss

panel.timeUntilDismiss = 0 // zero for wait forever
panel.enableTapDismiss = true
panel.showNotify(withStatus: .success, belowNavigation: self.navigationController!, title: "Tap me to dismiss")

Delegate

func notificationPanelDidDismiss ()
func notificationPanelDidTap()

User tap action

If you don't want to use delegate you can also use tap action instead.

panel.timeUntilDismiss = 0 // zero for wait forever
panel.enableTapDismiss = false
panel.addPanelDidTapAction() {
self.notificationPanelDidTap()
}
panel.showNotify(withStatus: .success, belowNavigation: self.navigationController!, title: "Tap me to show alert")

Orientation

JKNotificationPanel support orientation. Just call method 'transitionToSize' in ViewController

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)

coordinator.animate(alongsideTransition: { (context) in
self.panel.transitionTo(size: self.view.frame.size)
}, completion: nil)
}

Author

Ter, http://www.macfeteria.com

License

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100