SwiftPulse
Pulsing animation for Swift
Install / Use
/learn @ctews/SwiftPulseREADME
SwiftPulse
This is an iOS component for creating a single pulsing animation. It's a clone from PulsingHalo - so basically all the credits go to @shu223.
I just needed the single pulse animation (left one of the image) and decided to port it to Swift with some minor changes of the interfaces.
How to use
- Add LFTPulseAnimation to your project.
- Init LFTPulseAnimation (e.g. with its custom constructor) and add it to the view
pulseEffect = LFTPulseAnimation(repeatCount: Float.infinity, radius:20, position:imageView.center)
view.layer.insertSublayer(self.pulseEffect, below: imageView.layer)
Customization
radius
Use the radius property to set the max size of the pulse effect.
pulseEffect.radius = 60
color
This is is basically a subclass of CALayer so you can access the backgroundColor attribute of CALayer and set it like you are used to it.
animation duration
Use self.animationDuration to set the duration of one animation cycle. Use the self.pulseInterval property to add an interval to the duration.
animation repeat count
Initialize using LFTPulseAnimation(repeatCount: Float.infinity, radius:20, position:iv.center) to set the repeat count or use the repeatCount property
more properties
For more adjustment just look in the code, it's very easy to understand and should be seld documenting.
Issues & PRs
If someone is interested in porting the multiple pulse effect before I will do it just let me know or do a Pull Request ;)
Special Thanks
Special thanks to @shu223 for PulsingHalo!
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.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
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
