shu223/Pulsator
소개
iOS용 펄스 애니메이션
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- 0
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalPulsator
Pulse animation for iOS and macOS, usable from both UIKit and SwiftUI.
Great For:
- Pulses of Bluetooth, BLE, beacons (iBeacon), etc.
- Map Annotations
Installation
Swift Package Manager
In Xcode, choose File → Add Package Dependencies… and enter this repository's URL:
CocoaPods (deprecated)
Add into your Podfile.
pod "Pulsator"
Then $ pod install
How to use
SwiftUI
Just 1 line! Add the .pulsator() modifier to any view.
yourView
.pulsator()
UIKit
Initiate and add to your view's layer, then call start!
let pulsator = Pulsator()
view.layer.addSublayer(pulsator)
pulsator.start()
Customizations
SwiftUI example:
yourView
.pulsator(
numPulse: 3,
radius: 240,
animationDuration: 5,
color: pulseColor,
isPulsating: isPulsating
)
Number of Pulses
Use numPulse property.
pulsator.numPulse = 3
Radius
Use radius property.
pulsator.radius = 240.0
Color
Just set the backgroundColor property.
pulsator.backgroundColor = UIColor(red: 1, green: 1, blue: 0, alpha: 1).cgColor
Animation Duration
Use following properties
animationDuration: duration for each pulsepulseInterval: interval between pulses
Easing
You can set the timingFunction property.
Repeat
Use repeatCount property.
Demo
Try changing the radius, backgroundColor or other properties with the demo apps.
- SwiftUI:
Example/SwiftUI/PulsatorDemo.xcodeproj - UIKit:
Example/UIKit/PulsatorDemo.xcodeproj
macOS support
Add into your Podfile, then run pod install.
platform :osx, '10.9'
target 'Pulsator' do
use_frameworks!
pod "Pulsator"
end
The usage is same as iOS.
let pulsator = Pulsator()
view.layer?.addSublayer(pulsator)
pulsator.start()
Objective-C version
There is an ObjC version, but it's not maintained now.
You can use Pulsator also with Objective-C.
#import "Pulsator-Swift.h"
Author
Shuichi Tsutsumi
iOS freelancer in Japan. Welcome works from abroad!
관련 프로젝트 살펴보기
불러오는 중…