Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raphaelcruzeiro/SwiftyBadgeButton
A simple, fully tested, 100% Swift badge button.
https://github.com/raphaelcruzeiro/SwiftyBadgeButton
Last synced: about 1 month ago
JSON representation
A simple, fully tested, 100% Swift badge button.
- Host: GitHub
- URL: https://github.com/raphaelcruzeiro/SwiftyBadgeButton
- Owner: raphaelcruzeiro
- License: mit
- Created: 2016-06-04T01:32:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-05T19:04:56.000Z (about 2 years ago)
- Last Synced: 2024-03-15T11:04:29.495Z (9 months ago)
- Language: Ruby
- Homepage:
- Size: 618 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Open-Source-Ruby-and-Rails-Apps - SwiftyBadgeButton - A simple, fully tested, 100% Swift badge button. 🔥 🚀 (Happy Exploring 🤘)
README
## Installation
```
use_frameworks!pod 'SwiftyBadgeButton'
```## Usage
SwiftyBadgeButton is a subclass of UIButton and can be used just as one. To set the badge, all you need to so is set a text:
```
badgeButton.badgeText = "1"
```## Properties
- `animated` Sets whether the badge should animate upon setting a badgeText. _Default: true_
- `badgeInset` Sets the insets and outsets for the badge
- `badgeSize` Sets the default badge size. The width will grow automatically according to the text. The height will always stay the same. _Default: CGSize(width 15, height: 15)
- `badgeBackgroundColor` Sets the badge background color. _Default: UIColor.red_
- `badgeFont` Sets the badge font. _Default: UIFont.systemFont(ofSize: 10)_
- `badgeTextColor` Sets the badge text color. _Default: UIColor.white_