ClapsView 2.0.0

ClapsView 2.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Hemang Shah.



ClapsView 2.0.0

  • By
  • hemangshah

ClapsView 👏

Implemented the functionality of Medium.com Claps.






  1. Screenshots
  2. Features
  3. Installation
  4. Usage Guide
  5. Setup
  6. ToDos
  7. Credits
  8. Thanks
  9. 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

  • Storyboard - Add a UIView and change the class in Identity Inspector to ClapsView.
  • Manually - Add ClapsView.swift file to your Project.
  • CocoaPods – Coming soon.

Usage Guide

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

Setup

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.