Skip to content

TDBadgedCell is a UITableViewCell subclass that adds badges, to table view cells. It's highly customisable, allowing you to alter the badge colours, shape, and positioning.

Notifications You must be signed in to change notification settings

andriariii/TDBadgedCell

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TDBadgedCell

Meet TDBadgedCell version 2

TDBadgedCell grew out of the need for TableViewCell badges and the lack of them in iOS (see the article explaining this on TUAW. TDBadgedCell was written originally using CGPaths but as more people began to use TDBadgeCell the more customisation people wanted. The class works in both ARC and non-ARC projects automatically (thanks coryallegory).

To set the content of your badge (NSString) simply do:

cell.badgeString = @"130990";

You can set badgeColor and badgeColorHighlighted to modify the colour of the badges:

cell.badgeColor = [UIColor colorWithRed:0.792 green:0.197 blue:0.219 alpha:1.000];

You can also specify a border radius and font size for your badges:

cell.badge.radius = 9;
cell.badge.fontSize = 18;

and you can also turn on shadows for the cells selected state:

cell.showShadow = YES;

Below is an example of those different options enabled in the demo app.

Example Image

Licence and that stuff

TDBadgedCell is a free to use class for everyone. I wrote it so people could have the badges Apple never provided us with. If you modify the source please share alike and if you think you've improved upon what I have written I recomend sending me a pull request.

Please note: If you are using TDBadgedCell in your project please make sure you leave credit where credit is due. Chances are I won't notice if you haven't left credit but karma will…

About

TDBadgedCell is a UITableViewCell subclass that adds badges, to table view cells. It's highly customisable, allowing you to alter the badge colours, shape, and positioning.

Resources

Stars

Watchers

Forks

Packages

No packages published