Skip to content

Commit

Permalink
[badge] Standardize the documentation format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jverkoey committed Jun 20, 2012
1 parent 52c3b51 commit 94790a8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 22 deletions.
Binary file added docs/gfx/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 35 additions & 22 deletions src/badge/src/NIBadgeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,56 @@
#import <UIKit/UIKit.h>

/**
* A styled view that mimics the iOS badge on a app icon.
* A view that mimics the iOS notification badge style.
*
* @ingroup NimbusBadge
* Any NSString can be displayed in this view, though in practice you should only show numbers
* ranging from 1...99 or the string @"99+". Apple is quite consistent about using the red badge
* views to represent notification badges, so you should do your best not to attach additional
* meaning to the red badge.
*
* @image html badge.png "A default NIBadgeView"
*
* This style comprises of four elements: the main colored background, the
* white border, the gloss effect and a drop shadow. The tint color of the
* view is customizable, but defaults to the standard red.
* @ingroup NimbusBadge
*/
@interface NIBadgeView : UIView
@property (nonatomic, readwrite, copy) NSString* text;
@property (nonatomic, readwrite, retain) UIFont* font;
@property (nonatomic, readwrite, retain) UIColor* textColor;
@property (nonatomic, readwrite, retain) UIColor* tintColor;
@end

/** @name Accessing the Text Attributes */

/**
* The text to display within the badge.
* The text displayed within the badge.
*
* @attention If you want the view to resize based on the text be sure
* be sure to call -sizeToFit after you set the text, as this
* will not happen automatically.
* As with a UILabel you should call sizeToFit after setting the badgeView properties so that it
* will update its frame to fit the contents.
*
* @fn NIBadgeView::text
*/
@property (nonatomic, readwrite, copy) NSString* text;

/**
* The tint color of the badge. The default color is red.
* The font of the text within the badge.
*
* The default font is [UIFont boldSystemFontOfSize:17].
*
* @sa text
* @fn NIBadgeView::font
*/
@property (nonatomic, readwrite, assign) UIColor* tintColor;

/**
* The font of the text within the badge.
* The default is bold system font of size 13.
* The color of the text in the badge.
*
* @attention If you want the view to resize based on the font size be
* sure be sure to call -sizeToFit after you set the text, as
* this will not happen automatically.
* The default color is [UIColor whiteColor].
*
* @fn NIBadgeView::textColor
*/
@property (nonatomic, readwrite, assign) UIFont* font;

/**
* The text color for the badge. The default color is white.
* The tint color of the badge.
*
* The default color is [UIColor redColor].
*
* @fn NIBadgeView::tintColor
*/
@property (nonatomic, readwrite, assign) UIColor* textColor;

@end

0 comments on commit 94790a8

Please sign in to comment.