/ClapsView

Implemented the functionality of Medium.com Claps. 👏

Primary LanguageSwiftMIT LicenseMIT

ClapsView 👏

Implemented the functionality of Medium.com Claps.

License Platform Swift 4.x MadeWithLove Awesome-Swift

  1. Screenshots
  2. Features
  3. Installation
  4. Usage Guide
  5. Setup
  6. Usage
  7. ToDos
  8. Credits
  9. Thanks
  10. License

Screenshots

Usage Usage
Usage

Features

  1. Create Programmatically or in Storyboard.
  2. Dynamic Property Configurations.
  3. Replica of Medium.com's Claps.
  4. Lightweight with zero dependancies.

Installation

  1. Storyboard – Add a UIView and change the class in Identity Inspector to ClapsView.
  2. Manually – Add ClapsView.swift file to your Project.
  3. CocoaPodspod 'ClapsView'

You can read the CHANGELOG file for a particular release.

Usage Guide

  • Long Press – To start clapping. 👏
  • Double Tap - To remove current claps.
  • Single Tap - To see current Claps.

Setup

import ClapsView

Usage

let claps = ClapsView.init(frame: CGRect.init(origin: CGPoint.zero, size: CGSize.init(width: 100.0, height: 100.0)))
claps.delegate = self
//Customize Emoji.
claps.emoji = "👏"
//The number of claps by all of the user.
claps.totalClaps = 30
//The maximum number of claps a user can do.
claps.maxClaps = 50
//If set true, 1000 claps will be display as 1k
claps.showClapsAbbreviated = true
self.view.addSubview(claps)
claps.center = self.view.center

//Implementing Delegate Call
extension ViewController: ClapsViewDelegate {
    func clapsViewStateChanged(clapsView: ClapsView, state: ClapsViewStates, totalClaps: Int, currentClaps: Int) {
        if state == .finalized {
            print("ClapsViewTag: \(clapsView.tag) | Total Claps:\(totalClaps) | Current Claps:\(currentClaps)")
        }
    }
}

ToDo[s]

  • CocoaPods Support

You can watch to ClapsView to see continuous updates. Stay tuned.

Have an idea for improvements of this class? Please open an issue.    

Credits

Hemang Shah

You can shoot me an email to contact.  

Thank You!!

See the contributions for details.

License

The MIT License (MIT)

Read the LICENSE file for details.