Skip to content

vdka/Notify

Repository files navigation

Notify

Carthage compatible CI Status

Notify allows you to present notifications to your users with a simple interface.

Hello

Notify(title: "Hello world!").present()

Customization

init(title: String, backgroundColor: UIColor = .orangeColor(), titleColor: UIColor = Notify.currentStatusBarTextColor, font: UIFont = .boldSystemFontOfSize(12))
func present(dismiss dismiss: Dismissal = .After(2.0), completion: (() -> Void)? = nil)
enum Dismissal {
  case After(NSTimeInterval)
  case OnTap
}

Recommended Extension

In order to match the current status bar Notify calls preferredStatusBarStyle() & preferredStatusBarHidden() on the keyWindow of your apps rootViewController.

If your application's rootViewController is typically a UINavigationController or subclass thereof, then without this extension it will be the one to decide the visuals of your status bar.

extension UINavigationController {
  public override func preferredStatusBarStyle() -> UIStatusBarStyle {
    return topViewController?.preferredStatusBarStyle() ?? .Default
  }

  public override func prefersStatusBarHidden() -> Bool {
    return topViewController?.prefersStatusBarHidden() ?? false
  }
}

About

A lightweight iOS notification banner

Resources

License

Stars

Watchers

Forks

Packages

No packages published