Badges View, a component to show badges everywhere on your application
This component will allow you to put an iOS Badge-like everywhere in your application. So it is now not limited to the UITabBar or to the application icon.
You can change its color, size, set it to have a shadow or not, and to blink, change its font color and size, etc.
It is actually used on 3 different commercial apps so it fits "Apple recommendations".
Please note that this documentation is included in the package, as well as a sample application.
1) Include both LTBadgesView.h & LTBadgesView.m in your project
2) If you want to use the IB Editor :
Add a UIView to your project that will fit with your badge needs (formerly use twice the height for the width, for example 80x40 pixels), put its color to transparent background and attach its style to LTBadgesView
Declare it as an outlet in you class declaration and access its method to change its value, colors & attributes
3) By code, you can use this kind of declaration :
badge1 = [[LTBadgesView alloc] initWithFrame:CGRectMake(50, 100, 50, 40)]; [badge1 setMainColor:[UIColor redColor]]; [badge1 setValue:@"1"]; [badge1 setTextSize:18]; [badge1 setHighlightColor:[UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1.0]]; [self.view addSubview:badge1];
Available methods :
- (void)setValue:(NSString *)newValue;
- (void)setMainColor:(UIColor *)newColor;
- (void)setHighlightColor:(UIColor *)newColor;
- (void)setBorderColor:(UIColor *)newColor;
- (void)setTextColor:(UIColor *)newColor;