Skip to content

TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps

License

Notifications You must be signed in to change notification settings

fulldecent/TDBadgedCell

 
 

Repository files navigation

TDBadgedCell

TDBadgedCell grew out of the need for TableViewCell badges and the lack of them in iOS (see the article explaining this on TUAW. Recently the project has been re-written in Swift and much simplified.

Installation

Add this to your project using Swift Package Manager. In Xcode that is simply: File > Swift Packages > Add Package Dependency... and you're done. Alternative installations options are shown below for legacy projects.

CocoaPods

If you are already using CocoaPods, just add 'TDBadgedCell' to your Podfile then run pod install.

Carthage

If you are already using Carthage, just add to your Cartfile:

github "fulldecent/TDBadgedCell" ~> 0.1

Then run carthage update to build the framework and drag the built TDBadgedCell.framework into your Xcode project.

Note: You can find the old Objective-C version on the deprecated-objective-c branch.

 

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

cell.badgeString = "Hello, World!"

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

cell.badgeColor = UIColor.orangeColor()

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

cell.badgeRadius = 9;
cell.badgeFontSize = 18;

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…

About

TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 84.5%
  • Shell 9.3%
  • Ruby 6.2%