ale

AlertBar

An easy alert on status bar

Showing:

Popularity

Downloads/wk

0

GitHub Stars

65

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

AlertBar

Version License Platform Carthage compatible

An easy alert on status bar.

Demo
demo

Usage

Import

import AlertBar

Show alert message

AlertBar has default types:

  • success
  • error
  • notice
  • warning
  • info
AlertBar.show(type: .success, message: "This is a Success message.")

And you can customize the background and text colors of AlertBar.
Select custom type and set background and text colors as UIColor: .custom(BackgroundColor, TextColor)

AlertBar.show(type: .custom(.lightGray, .black), message: "This is a Custom message.")

Alert duration

AlertBar accepts to custom alert duration.

AlertBar.show(type: .success, message: "This is a Success message.", duration: 10)

AlertBar Options

AlertBar accepts options follows:

  • Consider Safe Area
  • Stretch bar
  • TextAlignment

Use setDefault method to set default options.

let options = AlertBar.Options(
    shouldConsiderSafeArea: true, 
    isStretchable: true, 
    textAlignment: .center,
    font: UIFont.systemFont(ofSize: 14.0, weight: .medium)
)
AlertBar.setDefault(options: options)

Or set parameter of show method to each AlertBar.

let options = AlertBar.Options(
    shouldConsiderSafeArea: true, 
    isStretchable: true, 
    textAlignment: .center,
    font: UIFont.systemFont(ofSize: 14.0, weight: .medium)
)
AlertBar.show(type: .success, message: "This is AlertBar!", options: options)

Consider Safe Area

The Safe Area is adopted from iOS 11 and AlertBar can change whether to consider SafeArea or not.

AlertBar.Options#shouldConsiderSafeArea: Bool is set to true by default.

shouldConsiderSafeArea == trueshouldConsiderSafeArea == false
truefalse

Stretch bar

AlertBar can stretch the bar if the message needs the multi lines.

AlertBar.Options#isStretchable: Bool is set to false by default.

isStretchable == trueisStretchable == false
truefalse

TextAlignment

AlertBar accepts to custom text alignment.

Installation

CocoaPods

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

pod "AlertBar"

Carthage

AlertBar is available through Carthage since 0.3.1. To install it, simply add the following line to your Cartfile:

github "jinSasaki/AlertBar"

Author

Jin Sasaki, sasakky_j@gmail.com

License

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100