Giter Club home page Giter Club logo

jdstatusbarnotification's Introduction

JDStatusBarNotification

Show messages on top of the status bar. Customizable colors, font and animation. Supports progress display and can show an activity indicator. iOS 7 ready. iOS6 support.

Animation

Screenshots

Installation

Install via pods:
pod 'JDStatusBarNotification'

Manually:

  1. Drag the JDStatusBarNotification/JDStatusBarNotification folder into your project.
  2. Add #include "JDStatusBarNotification.h", where you want to use it

Usage

JDStatusBarNotification is a singleton. You don't need to initialize it anywhere. Just use the following class methods:

Showing a notification

+ (UIView*)showWithStatus:(NSString *)status;
+ (UIView*)showWithStatus:(NSString *)status
             dismissAfter:(NSTimeInterval)timeInterval;

The return value will be the notification view. You can just ignore it, but if you need further customization, this is where you can access the view.

Dismissing a notification

+ (void)dismiss;
+ (void)dismissAfter:(NSTimeInterval)delay;

Showing progress

Progress animation

+ (void)showProgress:(CGFloat)progress;  // Range: 0.0 - 1.0

Showing activity

Activity screenshot

+ (void)showActivityIndicator:(BOOL)show
               indicatorStyle:(UIActivityIndicatorViewStyle)style;

Showing a notification with alternative styles

Included styles:

Use them with the following methods:

+ (UIView*)showWithStatus:(NSString *)status
                styleName:(NSString*)styleName;
             
+ (UIView*)showWithStatus:(NSString *)status
             dismissAfter:(NSTimeInterval)timeInterval
                styleName:(NSString*)styleName;

To present a notification using a custom style, use the identifier you specified in addStyleNamed:prepare:. See Customization below.

Customization

+ (void)setDefaultStyle:(JDPrepareStyleBlock)prepareBlock;

+ (NSString*)addStyleNamed:(NSString*)identifier
                   prepare:(JDPrepareStyleBlock)prepareBlock;

The prepareBlock gives you a copy of the default style, which can be modified as you like:

[JDStatusBarNotification addStyleNamed:<#identifier#>
                               prepare:^JDStatusBarStyle*(JDStatusBarStyle *style) {
                               
                                   // main properties
                                   style.barColor = <#color#>;
                                   style.textColor = <#color#>;
                                   style.font = <#font#>;
                                   
                                   // advanced properties
                                   style.animationType = <#type#>;
                                   style.textShadow = <#shadow#>;
                                   style.textVerticalPositionAdjustment = <#adjustment#>;

                                   // progress bar
                                   style.progressBarColor = <#color#>;
                                   style.progressBarHeight = <#height#>;
                                   style.progressBarPosition = <#position#>;

                                   return style;
                               }];

Animation Types

  • JDStatusBarAnimationTypeNone
  • JDStatusBarAnimationTypeMove
  • JDStatusBarAnimationTypeBounce
  • JDStatusBarAnimationTypeFade

Progress Bar Positions

  • JDStatusBarProgressBarPositionBottom
  • JDStatusBarProgressBarPositionCenter
  • JDStatusBarProgressBarPositionTop

Twitter

I'm @jaydee3 on Twitter. Feel free to post a tweet, if you like JDStatusBarNotification.

TweetButton

jdstatusbarnotification's People

Contributors

calimarkus avatar kevingibbon avatar codeblooded avatar danylokos avatar

Watchers

Eric Shim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.