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.

Lists

README

        

# SwiftyBadgeButton


## 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_