Swiftpack.co - Package - shu223/Pulsator

Pulsator

Badge w/ Version Carthage compatible License Twitter

Pulse animation for iOS written with Swift.

Great For:

  • Pulses of Bluetooth, BLE, beacons (iBeacon), etc.
  • Map Annotations

Installation

CocoaPods

Add into your Podfile.

pod "Pulsator"

Then $ pod install

Carthage

Add into your Cartfile.

github "shu223/Pulsator"

Then $ carthage update

How to use

Just 3 lines!

Initiate and add to your view's layer, then call start!

let pulsator = Pulsator()
view.layer.addSublayer(pulsator)
pulsator.start()

Customizations

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 pulse
  • pulseInterval : interval between pulses

Easing

You can set the timingFunction property.

Repeat

Use repeatCount property.

Demo

You can try to change the radius, backgroundColor or other properties with the demo app.

  • Example/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.

  • https://github.com/shu223/PulsingHalo

You can use Pulsator also with Objective-C.

#import "Pulsator-Swift.h"

Author

Shuichi Tsutsumi

iOS freelancer in Japan. Welcome works from abroad!

Support via PayPal

Github

link
Stars: 1211

Dependencies

Used By

Total: 0

Releases

Swift 5.0 - 2019-06-29 04:58:50

Support Swift 5.0

Swift 4.2 Support - 2018-09-25 16:03:54

Carthage fix - 2018-05-18 03:31:58

Swift 4.1 - 2018-04-07 03:22:39

macOS support - 2018-04-07 02:36:08

Objective-C support - 2018-04-07 01:45:25

Swift 4 support - 2018-02-07 23:30:23

Fixed the .swift-version file

0.4.0 - 2017-09-30 00:08:25

Swift 4 and Xcode 9 support

0.3.0 - 2017-01-16 03:32:58

Supported resuming after background.

0.2.0 - 2016-09-18 06:42:35

Swift 3 / Xcode 8 Support

0.1.1 - 2016-05-27 13:38:29

Fixed a bug: https://github.com/shu223/Pulsator/issues/2