{"id":13849567,"url":"https://github.com/tmdvs/TDBadgedCell","last_synced_at":"2025-07-12T16:32:58.596Z","repository":{"id":56922651,"uuid":"461025","full_name":"tmdvs/TDBadgedCell","owner":"tmdvs","description":"TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps","archived":false,"fork":false,"pushed_at":"2024-04-15T09:45:57.000Z","size":1677,"stargazers_count":1433,"open_issues_count":3,"forks_count":181,"subscribers_count":47,"default_branch":"main","last_synced_at":"2024-11-11T23:51:21.246Z","etag":null,"topics":["badge","ios","swift","tableview","tableviewcell","ui","uitableview","uitableviewcell"],"latest_commit_sha":null,"homepage":"www.tmdvs.me","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmdvs.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2010-01-06T18:19:10.000Z","updated_at":"2024-08-08T07:52:53.000Z","dependencies_parsed_at":"2024-04-15T11:10:11.641Z","dependency_job_id":"172b151b-411c-4b8d-9454-e82c578cae35","html_url":"https://github.com/tmdvs/TDBadgedCell","commit_stats":{"total_commits":186,"total_committers":41,"mean_commits":4.536585365853658,"dds":0.6720430107526882,"last_synced_commit":"43db411f715db3ad2515e94a5d42f0cec3df4d82"},"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FTDBadgedCell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FTDBadgedCell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FTDBadgedCell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FTDBadgedCell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmdvs","download_url":"https://codeload.github.com/tmdvs/TDBadgedCell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224880425,"owners_count":17385370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["badge","ios","swift","tableview","tableviewcell","ui","uitableview","uitableviewcell"],"created_at":"2024-08-04T19:01:22.482Z","updated_at":"2024-11-22T01:31:03.396Z","avatar_url":"https://github.com/tmdvs.png","language":"Swift","readme":"# TDBadgedCell \n[![Version](https://img.shields.io/cocoapods/v/TDBadgedCell.svg?style=flat-square)](http://cocoapods.org/pods/TDBadgedCell/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat-square)](https://github.com/Carthage/Carthage)\n![Platform](https://img.shields.io/cocoapods/p/TDBadgedCell.svg?style=flat-square)\n![License](https://img.shields.io/cocoapods/l/TDBadgedCell.svg?style=flat-square)\n![Downloads](https://img.shields.io/cocoapods/dt/TDBadgedCell.svg?style=flat-square)\n\nTDBadgedCell grew out of the need for TableViewCell badges and the lack of them in iOS (see the [article explaining this on ~~TUAW~~ Engadget](https://www.engadget.com/2010/01/07/iphone-devsugar-simple-table-badges/)). Recently the project has been re-written in Swift and much simplified.\n\n\u003cimg src=\"http://up.tmdvs.me/j2a9/d\" width=\"432\"\u003e\u0026nbsp;\n\u003cimg src=\"http://up.tmdvs.me/j23l/d\" width=\"432\"\u003e\n\n## Usage and examples\nTDBadgedCell 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 your `cellForRowAt indexPath:` method:\n\n```swift\noverride func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell {\n  var cell = tableView.dequeueReusableCell(withIdentifier:\"BadgedCell\") as? TDBadgedCell;\n  if(cell == nil) {\n    cell = TDBadgedCell(style: .default, reuseIdentifier: \"BadgedCell\");\n  }\n\n  // ...\n  \n  return cell!\n}\n```\n\nYou can modify the badges appearance in a number of different ways.\n\n- ### Setting badge value\n  To set the content of your badge (String) simply do:\n\n  ```Swift\n  cell.badgeString = \"Hello, World!\"\n  ```\n\n- ### Changing the badge color\n  You can set _badgeColor_ and _badgeColorHighlighted_ to modify the colour of the badges:\n\n  ```Swift\n  cell.badgeColor = .orange\n  cell.badgeColorHighlighted = .green\n  ```\n\n- ### Setting the font size and text color\n  By default the badge text will be clipped out of the badge background allowing you to see through to the background colour beneath. However you can specify a text color manually along with the badges font size:\n\n  ```Swift\n  cell.badgeTextColor = .black;\n  cell.badgeFontSize = 18;\n  ```\n  \n- ### Corner radius\n  You can modify the badges corner radius allowing you to change the badges shape from the default \"pill\" shape to a square or rounded rectangle:\n  \n  ```Swift\n  cell.badgeRadius = 0;\n  ```\n\n- ### Badge Offset\n  You can set the badge's offset from the right hand side of the Table View Cell\n  ```Swift\n  cell.badgeOffset = CGPoint(x:10.0, y:0)\n  ```\n\n- ### Badge Text Offset\n  You can add an offset to the text within the badge\n  ```Swift\n  cell.badgeTextOffset = 5.0\n  ```\n  \nIf you have any feedback or feature requests, simply [open an issue](https://github.com/tmdvs/TDBadgedCell/issues) on the TDBadgedCell github repo.\n\n## Licence and that stuff\nTDBadgedCell 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.\n\n**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…\n","funding_links":[],"categories":["Swift","uitableviewcell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdvs%2FTDBadgedCell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmdvs%2FTDBadgedCell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdvs%2FTDBadgedCell/lists"}