GCDiscreetNotificationView

by gcamp

A discreet, non-modal, notification view for iOS.

416 Stars 82 Forks Last release: Not found Other 56 Commits 3 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

h1. GCDiscreetNotificationView

GCDiscreetNotificationView is a discreet, non-modal, notification view for iOS. You can use it to show an activity or state of you app without blocking the user interactions.

!http://i.imgur.com/8vcti5u.png!

GCDiscreetNotificationView features:

  • Easy to use : init and show
  • Can show an activity indicator
  • Two presentation mode (top and bottom)
  • All properties (text, activity and presentation mode) can be changed in a animated fashion

h2. Usage

(See the demo project included)

You simply allocate the notification view with one of the following methods.

The parameters are the following : * text : the text presented on the notification * activity : if set to @[email protected], the notification with show a activity indicator * aPresentationMode : the presentation mode of the notification (top or bottom) * aView : the view that will contain the notification. The view should be able to accept subviews (will not work on a @[email protected] for example)

- (id) initWithText:(NSString *)text inView:(UIView *)aView;
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inView:(UIView *)aView;
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inPresentationMode:(GCDiscreetNotificationViewPresentationMode) aPresentationMode inView:(UIView *)aView;

You show or hide the notification with these methods. The @showAndDismissAutomatical[email protected] will hide your notification automatically after 1 second.

- (void) showAnimated;
- (void) hideAnimated;
- (void) hideAnimatedAfter:(NSTimeInterval) timeInterval;
- (void) show:(BOOL) animated;
- (void) hide:(BOOL) animated;
- (void) showAndDismissAutomaticallyAnimated;
- (void) showAndDismissAfter:(NSTimeInterval) timeInterval;

You can change the text of the label of the activity viewing at any moment with these properties.

@property (nonatomic, assign) UIView *view;
@property (nonatomic, assign) GCDiscreetNotificationViewPresentationMode presentationMode;
@property (nonatomic, copy) NSString* textLabel;
@property (nonatomic, assign) BOOL showActivity;

These properties can be changed in a animated fashion (except the view).

- (void) setTextLabel:(NSString *) aText animated:(BOOL) animated;
- (void) setShowActivity:(BOOL) activity animated:(BOOL) animated;
- (void) setTextLabel:(NSString *)aText andSetShowActivity:(BOOL)activity animated:(BOOL)animated;
- (void) setPresentationMode:(GCDiscreetNotificationViewPresentationMode) newPresentationMode animated:(BOOL) animated;

You can access directly the notification's label and activity indicator. And change some propreties on that label and activity indicator. If you want to change the label's text or hide the indicator, use @[email protected] or @[email protected] instead.

@property (nonatomic, retain, readonly) UILabel *label;  
@property (nonatomic, retain, readonly) UIActivityIndicatorView *activityIndicator;

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.