Home

Awesome

BPStatusBarAlert

Version License Platform

BPStatusBarAlert is a library that allows you to easily make text-based alert that appear on the status bar and below navigation bar. </br>

Demo

StatusBar Position

<img src="https://cloud.githubusercontent.com/assets/9531750/22561102/400b9132-e9ba-11e6-8c25-8122fd108df5.gif" width="320" height="590" />

NavigationBar Position

<img src="https://cloud.githubusercontent.com/assets/9531750/22561105/4238acce-e9ba-11e6-8cc3-6dc9fd597a78.gif" width="320" height="590" />

Requirements

Installation

CocoaPods

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

pod "BPStatusBarAlert"

Manual

Copy the folder BPStatusBarAlert to your project

Usage

First, you need the following import BPStatusBarAlert

import BPStatusBarAlert

Now, you can uses BPStatusBarAlert simply like this

@IBAction func buttonTapped(_ sender: Any) {
    BPStatusBarAlert()
        .message(message: "Complete Sharing This Contents")
        .show()
}

Initialize BPStatusBarAlert with no parameters, it will set up default value for property Default setting

So, If you want customize property, just call init method with parameters and chaning function

public init(duration: TimeInterval = 0.3, delay: TimeInterval = 2, position: AlertPosition = .statusBar)

So, if you change time interval in animations and position of BPStatusBarAlert, using defaults paramaters

BPStatusBarAlert(duration: 0.3, delay: 2, position: .statusBar) // customize duration, delay and position
    .message(message: "Complete Sharing This Contents")         // customize message
    .messageColor(color: .white)                                // customize message color
    .bgColor(color: .blue)                                      // customize view's background color
    .completion { print("completion closure will called") }     // customize completion(Did hide alert view)
    .show()                                                     // Animation start

TODO

Author

Ben.Park, ppth0608@naver.com

Contribute

always welcome :) Only pull request.

License

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