Skip to content

Gypsyan/KGBadgeView

Repository files navigation

KGBadgeView - Get an awesome badge view 💥 👍

Build Status Swift3+ Compatible CocoaPods

A quick way to add badge icon on the UIView elements.

Alt Text

Cocoapods

use_frameworks!

target 'yourApp' do
    platform :ios, '9.0'
	pod 'KGBadgeView', '~> 1.0'
end

How to ??

Initialize

 let kgBadgeObj = KGBadgeView()
 kgBadgeObj.initWithView(view: yourViewElement)

Set Badge

kgBadgeObj.setCount(2)
kgBadgeObj.showCount()

Set Font

kgBadgeObj.setFont(fontObj: UIFont(name: "HelveticaNeue", size: 20)!)

Set Size

kgBadgeObj.setSize(width: 25, height: 25)

Set BackGround color

kgBadgeObj.setBackgroundColor(color: UIColor.red)

Set Text color

kgBadgeObj.setTextColor(color: UIColor.white)

Set Position

To set position for a badge use teh following

 kgBadgeObj.setPostion(xAxis: 110, yAxis: -10)

Set Animations

 kgBadgeObj.showAnimation(type: KGBadgeView.AnimType.shakeAnim)

Different animations,

  • KGBadgeView.AnimType.defaultAnim
  • KGBadgeView.AnimType.shakeAnim
  • KGBadgeView.AnimType.blinkAnim
  • KGBadgeView.AnimType.swingAnim
  • KGBadgeView.AnimType.pulseAnim

Support

For support raise an issue here.

Please feel free to contribute 💪✌️💯