Badge this. Badge that.
A Swift version of GIBadgeView that also supports UIImage as badge.
- Xcode 9
- Swift 4.0
BadgifySwift can be installed via CocoaPods or Carthage or manual
Before you start, make sure you have installed CocoaPods, you can follow the instructions here.
To integrate BadgifySwift into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'BadgifySwift'
end
and run
$ pod install
To integrate BadgifySwift into your Xcode project using Carthage, add this line in your Cartfile:
pod "BadgifySwift"
and run
$ carthage update --platform iOS
and then drag BadgifySwift.framework
from Carthage Build folder to your project. Further information can be found here
import BadgifySwift
let badgeView = BadgeView()
myView.addSubview(badgeView)
// Set badge value
badgeView.badgeValue = 10
// Set badge image
badgeView.badgeImage = myImage
// Increment / Decrement
badgeView.increment()
badgeView.decrement()