TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps
Last updated Jun 30, 2026
1.4k
Stars
180
Forks
4
Issues
0
Stars/day
Attention Score
65
Language breakdown
Swift 100.0%
โธ Files
click to expand
README
TDBadgedCell
TDBadgedCell grew out of the need for TableViewCell badges and the lack of them in iOS (see the article explaining this on TUAW Engadget). Recently the project has been re-written in Swift and much simplified.
Usage and examples
TDBadgedCell is designed to be a drop in replacement to UITableViewCell with the added benifit of a simple badge on the right hand side of the cell, similar to those you'll find in Mail.app and Settings.app. All you need to do to implement TDBadgedCell is supply a TDBadgedCell instance in yourcellForRowAt indexPath: method:
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCell(withIdentifier:"BadgedCell") as? TDBadgedCell;
if(cell == nil) {
cell = TDBadgedCell(style: .default, reuseIdentifier: "BadgedCell");
}
// ... return cell! }
You can modify the badges appearance in a number of different ways.
- ### Setting badge value
cell.badgeString = "Hello, World!"
- ### Changing the badge color
cell.badgeColor = .orange
cell.badgeColorHighlighted = .green
- ### Setting the font size and text color
cell.badgeTextColor = .black;
cell.badgeFontSize = 18;
- ### Corner radius
cell.badgeRadius = 0;
- ### Badge Offset
cell.badgeOffset = CGPoint(x:10.0, y:0)
- ### Badge Text Offset
cell.badgeTextOffset = 5.0
If you have any feedback or feature requests, simply open an issue on the TDBadgedCell github repo.
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 recommend 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โฆ
๐ More in this category