CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

NotificationBanner 1.0.6

NotificationBanner 1.0.6

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jul 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by joehour.



  • By
  • joe

NotificationBanner

A foreground notification banner library, easy to use and customizable.

Features

  • [x] Provide Success, Info, Warning, Error, and Custom banner type.
  • [x] Adapt itself to the device orientation.
  • [x] Handle click event.

Requirements

  • iOS 8.0+
  • Xcode 8.0+ Swift 3

Installation

Source Code

Copy the NotificationBanner Directory to your project. Go ahead and import NotificationBanner to your file.

Example

Please check out the Example project included.

Usage

  • Sample:
import NotificationBanner

class ViewController: UIViewController, NotificationBannerDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()

        //Show NotificationBanner
        showNotificationBanner(bannerStyle: .successMessage, bannerLocation: .Top,
                               messageTitle: "Success", messageContent: "This is a Success notification")
        
    }

    
    //NotificationBanner click event(required)
    func notificationBannerClick(_ view: NotificationBannerView) {
        
        //Dissmiss NotificationBanner
        dissmissBanner(completion: { Sucess in _ = Bool()
            if(Sucess){
              
            }
        }
        )
   
    }
}

Customization

You can configure NotificationBanner properties.

  • NotificationBanner style(Success, Info, Warning, Error, and Custom banner type)*
bannerStyle: .successMessage   //Success style
bannerStyle: .infoMessage     //Info style
bannerStyle: .warningMessage  //Warning style
bannerStyle: .errorMessage    //Error style
bannerStyle: .customView      //Custom style
  • NotificationBanner location on the view
bannerLocation: .Top     //Top
bannerLocation: .Bottom  //Bottom
  • NotificationBanner title message
messageTitle: String     //title message
  • NotificationBanner content message
messageContent: String     //content message
  • NotificationBanner title string font
messageTitleFont: CGFloat     //title string font, default is 25
  • NotificationBanner content string font
messageContentFont: CGFloat     //content string font, default is 15
  • NotificationBanner Height
bannerHeight: Int     //banner height, default is 80
  • NotificationBanner hold time(second)
bannerHoldTime: Int     //banner hold time, default is 5 sec
  • If your bannerStyle is .customView(Custom style), you can configure bannerBackgroundColor and bannerImage properties
bannerBackgroundColor: UIColor     //banner background color
bannerImage: UIImage               //banner icon image

License

NotificationBanner is available under the MIT License.

Copyright © 2016 Joe.