项目作者: maios

项目描述 :
Badge this. Badge that.
高级语言: Swift
项目地址: git://github.com/maios/BadgifySwift.git
创建时间: 2018-02-05T18:26:16Z
项目社区:https://github.com/maios/BadgifySwift

开源协议:MIT License

下载


BadgifySwift

Badge this. Badge that.

A Swift version of GIBadgeView that also supports UIImage as badge.

Requirements

  • Xcode 9
  • Swift 4.0

Installations

BadgifySwift can be installed via CocoaPods or Carthage or manual

CocoaPods

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:

  1. source 'https://github.com/CocoaPods/Specs.git'
  2. platform :ios, '10.0'
  3. use_frameworks!
  4. target '<Your Target Name>' do
  5. pod 'BadgifySwift'
  6. end

and run

  1. $ pod install

Carthage

To integrate BadgifySwift into your Xcode project using Carthage, add this line in your Cartfile:

  1. pod "BadgifySwift"

and run

  1. $ carthage update --platform iOS

and then drag BadgifySwift.framework from Carthage Build folder to your project. Further information can be found here

Usage

  1. import BadgifySwift
  2. let badgeView = BadgeView()
  3. myView.addSubview(badgeView)
  4. // Set badge value
  5. badgeView.badgeValue = 10
  6. // Set badge image
  7. badgeView.badgeImage = myImage
  8. // Increment / Decrement
  9. badgeView.increment()
  10. badgeView.decrement()