From 94790a89b01c1bb5dc0aafdc301bb69ceef23822 Mon Sep 17 00:00:00 2001 From: jverkoey Date: Wed, 20 Jun 2012 16:52:17 -0700 Subject: [PATCH] [badge] Standardize the documentation format. --- docs/gfx/badge.png | Bin 0 -> 7709 bytes src/badge/src/NIBadgeView.h | 57 ++++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 docs/gfx/badge.png diff --git a/docs/gfx/badge.png b/docs/gfx/badge.png new file mode 100644 index 0000000000000000000000000000000000000000..e8b6b601c27316023689f176dbcdbd794e229cf9 GIT binary patch literal 7709 zcmZX3WmFu@vhCmw!3h%FWv~E2hT!gQ!CeNJ!GgO(fZ%R{1P>709R?5X4#C~w<~!%S zd(T?0*Q)O7s=cea>PP+QNL6JSEOb(I004j`Co8G`_k8)UNwB}b1{v$2HW{SsZun^aGNc|ZCPyMIn668=dSm-dn zI1S9>t~A%=mou2vo`5G$cY;x$^7?s9w_062uWcF}7h07YNF6n)g(#Fn>+pJpP`GvU zGMJPIe_io%7A$8abpB23{sSF%l-~kE>U}8bX-o@7GQU*+{Ly?9&+N*XYS|hjaP2NB z)?Gm8!mVT9_;RI&os(f=6*0Mxj~2>h@koI!C=)UwIygwsSLzs{NVTvXZ^+1fHJ2g% zNOQBTyF?+1S}?x`Ts9pD7rG!fPV9;UtL0KL2H;Y`ai1ZqQjxZ?mf$0OTL$@SL=QOi7dD=MC%ZI32a)OFSr(frcfyDaRAPNgy0vh zB5Rb_Ux(vNbecc6k|}Ux5Fo#!{itr{s?J2Wp2JhkUag*HKhi1}qB=}|+Mq&o#CY&V z95B{Kc}`8y{kjnwM-t;Y`WiO?ZsF`M^&sT>OrrFAyfmJRjRc!2QthKiW%Q)9d0vG4 zYviW?m^9wq>xKJrRZ~bn!@h90*%O}GL_OjaEe-yV7+fHiPxHRhK||&^@3M>?e{NPx zIr;p8w}$|LZRurEgF40gbx?MHQOguLpz$T1tpGP5#SLmNbQZ6;{}xal4ajQR$5)7Z zRG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0V*dt9S)rVaS%|1fX#6nmnbbQ#g$q02ir9Z7eIHxutkKm!1VE zEht>Ry&`n*n^_|i)6!gbHP!d-S*SZC<$P;k$xYIICyJMgdZm$i6s9Rx?ensnG=U_l z@B?*doBf@HX>m-W8ahGF}E`;{Mi@VPDH5jF=n0#C+gQ6K7yDm)Aq|Qx>zDNa9com1VQ%hCWE2#mCQbC2%k@A=c5 zbhfoR*nOhl)p-P)8LPQpk2gxqUK&4}G{wM|t7Av!J(T2UG;-bF4d36We=iyul8cRv zy~iRWAyEZ`s|MWN#TX0;*E$rYr`4@Xpz8t42h;Ky8Lgvtca33TVQhEWLQcN!9`0qT zO!GH<+EovP2tTL4fB(+ha?2oWDkBsAQ1Qe02P2!^ywmE!f*#KD^mJimB?qNk5_>@D zled}o4i46ax;u}1nYgqNKmXpjkmGeZxBaOg2Ue_E fn;#}I%6LK{SZ~SCNX9$;XFAJCDN9z0n*{w2aX`i) literal 0 HcmV?d00001 diff --git a/src/badge/src/NIBadgeView.h b/src/badge/src/NIBadgeView.h index b47b654a9..df370ab90 100644 --- a/src/badge/src/NIBadgeView.h +++ b/src/badge/src/NIBadgeView.h @@ -17,43 +17,56 @@ #import /** - * 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