MMDBadgeView is a quick, easy, and simple subclass of UILabel that looks like iOS style badges.
Yep! We needed a good badge view when we were working on This2That, but we never found anything we felt was simple enough to suit our needs. What we really wanted was a UILabel that looked like a badge so we could style it the way we would any other label and get a good looking badge.
That was the impetus for the MMDBadgeView. At the time of writing, all styles were configurable via Interface Builder.
Drag a UILabel onto your layout in Interface Builder, set the text, and center it. In Identity Inspector, change its class to MMDBadgeView.
No, Seriously, how do I use it?
Seriously, that's it. It's just a label after all
Currently, it just draws the badge background and does its best to infer the desired size of the border as a percentage of the height of the text control you're putting it on. It works for most of the stuff we've done. In the future, we'd like to make some things configurable programmatically like stroke size, but we haven't yet.
- Some programmatic configuration
- Stroke size
- Stroke color
- Some IB configuration
- Text alignment