LikeEffect
制作一个简单的点赞效果
Install / Use
/learn @HuangRunHua/LikeEffectREADME
LikeEffect
I worte this demo for learning, this demo is a clap animation can be used in many app.
Requirements
- Xcode9 and later
- iOS 12.1 and later
- Swift4.0 and later
Demo
let's see what would happen when you run this simple project.

Usage
First you must develop your own clap button, and add the code in ViewController.swift
The following codes are the function when you touch the button.
@objc func likeButtonTapped(sender: UIButton) {
feedbackGenerator?.impactOccurred()
flag = !flag
if flag {
likeButton.setImage(UIImage(named: "2"), for: .normal)
playAnimation()
/**
*设定一段时间以后停止发射粒子
*/
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
self!.emitterLayer.removeFromSuperlayer()
}
} else {
likeButton.setImage(UIImage(named: "1"), for: .normal)
}
scaleLikeButton()
}
More
If you want to know how it was built, you can see make a simple clap demo for reference
Related Skills
node-connect
340.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.2kCommit, push, and open a PR
