Giter VIP home page Giter VIP logo

pulsator's Introduction

Pulsator

Badge w/ Version Carthage compatible License Twitter

Pulse animation for iOS written with Swift.

Great For:

  • Pulses of Bluetooth, BTLE, 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
<iframe src="https://appetize.io/embed/45kwjngp1xud45eeqhxqy8qqew?device=iphone6s&scale=75&autoplay=false&orientation=portrait&deviceColor=black" width="312px" height="653px" frameborder="0" scrolling="no"></iframe>

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!

pulsator's People

Contributors

shu223 avatar brightsider avatar ajacquelin avatar creitz avatar dealforest avatar woodencoder avatar

Watchers

James Cloos avatar Ahmer Baig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.