Skip to content
프로젝트

소개

Pulsing animation for Swift

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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.

PulsingHalo

How to use

  1. Add LFTPulseAnimation to your project.
  2. 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!

관련 프로젝트 살펴보기

불러오는 중…