Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mustafaibrahim989/MIBadgeButton-Swift
iOS custom badge button.
https://github.com/mustafaibrahim989/MIBadgeButton-Swift
Last synced: 3 months ago
JSON representation
iOS custom badge button.
- Host: GitHub
- URL: https://github.com/mustafaibrahim989/MIBadgeButton-Swift
- Owner: mustafaibrahim989
- License: mit
- Created: 2014-08-27T22:27:22.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-11-30T03:09:16.000Z (almost 4 years ago)
- Last Synced: 2024-07-02T16:54:36.372Z (4 months ago)
- Language: Swift
- Homepage:
- Size: 560 KB
- Stars: 342
- Watchers: 12
- Forks: 80
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - MIBadgeButton - Notification badge for UIButtons. (UI / Badge)
- awesome-ios-star - MIBadgeButton - Notification badge for UIButtons. (UI / Badge)
- awesome-swift-cn - MIBadgeButton - Notification badge for UIButtons. (Libs / UI)
README
# MIBadgeButton
MIBadgeButton is badge button written in Swift with high UITableView/UICollectionView performance.
## Screenshots
![alt tag](https://github.com/mustafaibrahim989/MIBadgeButton-Swift/blob/master/screenshot.png)
## Installation
MIBadgeButton is available through [CocoaPods](http://cocoapods.org), to install
it simply add the following line to your Podfile:
# Swift 3
use_frameworks!
pod "MIBadgeButton-Swift", :git => 'https://github.com/mustafaibrahim989/MIBadgeButton-Swift.git', :branch => 'master'
# Swift 2
use_frameworks!
pod "MIBadgeButton-Swift", :git => 'https://github.com/mustafaibrahim989/MIBadgeButton-Swift.git', :branch => 'swift2'Add MIBadgeButton to Storyboard or init with frame
```swift
button.badgeString = "120"
```
Set EdgeInsets to change the default position of the badge (Optional)
```swift
button.badgeEdgeInsets = UIEdgeInsetsMake(10, 0, 0, 15)
```
Change the badge text color and background color
```swift
button.badgeTextColor = UIColor.blueColor()
button.badgeBackgroundColor = UIColor.redColor()```
## Author
Mustafa Ibrahim, [email protected]
Notes
============Designed for iOS 8.
## License
MIBadgeButton is available under the MIT license. See the LICENSE file for more info.