gokulgovind / GLNotificationBar

GLNotificationBar is a ios10 style notification bar, can be used to handle push notification in active state.
MIT License
302 stars 44 forks source link
cocoapods ios notifications objective-c swift

GLNotificationBar

CI Status Version License Platform

FYI: Updated with XCode 9.0 & swift 4.0.

overView

Note

GLNotificationBar is a library that allows you to easily create banner notifications that appear on top of screen, used to handle push notification in active state.Made with xcode 8.3.1 and swift 3

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

GLNotificationBar requires iOS 8.0+.

Installation

CocoaPods

GLNotificationBar is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GLNotificationBar'

Manual

Copy the file GLNotificationBar.swift & GLNotificationBar.xib from ~/GLNotificationBar/GLNotificationBar/Classes to your project.

User Guide

Swift:

  let notificationBar = GLNotificationBar(title: "Today Quote", message: "Yesterday is today's memory, and tomorrow is today's dream.", preferredStyle: .DetailedBanner, handler: nil)
  notificationBar.addAction(GLNotifyAction(title: "Like", style: .Default, handler: { (action) in
     print("I Like this quote")
  }))
  notificationBar.addAction(GLNotifyAction(title: "Cancel", style: .Cancel, handler: nil))

Objective C:

Diving In Depth

There are two types of GLNotificationBar style and Five type of GLNotifyAction types.

Author

gokul, gokulece26@gmail.com

Contributors

CavalcanteLeo, https://github.com/CavalcanteLeo

jameshays, https://github.com/jameshays

Social

License

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