Latest 1.0.0
Homepage https://github.com/macfeteria/JKNotificationPanel
License MIT
Platforms ios 8.0, requires ARC
Authors

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.

Latest podspec

{
    "name": "JKNotificationPanel",
    "version": "1.0.0",
    "summary": "Simple, Customizable notification panel (iPhone & iPad)",
    "description": "JKNotificationPanel lets you create a simple notification panel that display on the top of the view/navigation or below.",
    "homepage": "https://github.com/macfeteria/JKNotificationPanel",
    "screenshots": "https://raw.githubusercontent.com/macfeteria/JKNotificationPanel/master/Screenshot/jknotification_screen.gif",
    "authors": {
        "Ter": "[email protected]"
    },
    "source": {
        "git": "https://github.com/macfeteria/JKNotificationPanel.git",
        "tag": "1.0.0"
    },
    "license": "MIT",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "JKNotificationPanel": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This