ClapsView
ClapsView copied to clipboard
Implemented the functionality of Medium.com Claps. 👏
ClapsView 👏
Implemented the functionality of Medium.com Claps.
- Screenshots
- Features
- Installation
- Usage Guide
- Setup
- Usage
- ToDos
- Credits
- Thanks
- License
Screenshots
![]() |
![]() |
|
![]() |
Features
- Create Programmatically or in Storyboard.
- Dynamic Property Configurations.
- Replica of Medium.com's Claps.
- Lightweight with zero dependancies.
Installation
-
Storyboard – Add a
UIView
and change the class in Identity Inspector toClapsView
.
-
Manually – Add
ClapsView.swift
file to your Project.
-
CocoaPods –
pod '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]
- [x] 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
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.