HBStatusBarNotification 1.0.1

HBStatusBarNotification 1.0.1

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

Maintained by Haven Barnes.


Downloads

Total36
Week0
Month1

Installs

Apps6
powered by Segment

GitHub

Stars4
Watchers1
Forks0
Issues0
Contributors1
Pull Requests0

Code

Files1
LOCLines of Code 96


  • By
  • havenbarnes

HBStatusBarNotification




HBStatusBarNotification is an extremely lightweight solution for quickly dispatching status bar overlay notifications anywhere in your iOS application using one line of code. No additional setup or configuration is required.

Usage

Using HBStatusBarNotification is as simple as:

HBStatusBarNotification(message: "Internet Connection Lost", backgroundColor: UIColor.red).show()

Optionally, you can customize any combination of the other appearances / behaviors:

let notification = HBStatusBarNotification(message: "Internet Connection Lost", 
                        backgroundColor: UIColor.black, 
                        textColor: UIColor.red, 
                        statusBarStyle: .lightContent, 
                        duration: 6.0, 
                        font: UIFont(name: ".SFUIDisplay-Heavy", size: 10)!, 
                        notificationHeight: 40)
notification.show()

The notification will attempt to size down longer strings if they would not fit the width of the screen with the specified font size.

Example

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

Installation

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

pod "HBStatusBarNotification"

Author

havenbarnes, [email protected]

License

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