iOS Component for creating a pulsing animation.

Overview

PulsingHalo

PulsingHalo has been discontinued, and is no longer being maintained. Please check out Pulsator which is the new version of this written with Swift.

Carthage compatible Badge w/ Version License

iOS component for creating a pulsing animation. It allows you to create halos.

Great For:

  • Pulses of beacons (iBeacon)
  • Map Annotations

Installation

CocoaPods

Add into your Podfile.

pod "PulsingHalo"

Then $ pod install

Carthage

Add into your Cartfile.

github "shu223/PulsingHalo"

Then $ carthage update

Manual

Add PulsingHaloLayer.h,m into your project.

How to use

Just initiate and add to your view layer.

Swift

let halo = PulsingHaloLayer()
halo.position = view.center
view.layer.addSublayer(halo)
halo.start()

Objective-C

PulsingHaloLayer *halo = [PulsingHaloLayer layer];
halo.position = self.view.center;
[self.view.layer addSublayer:halo];
[halo start];

Customizations

Number of Halos

Use haloLayerNumber property.

halo.haloLayerNumber = 3;

radius

Use radius property.

self.halo.radius = 240.0;

color

Use backgroundColor property.

UIColor *color = [UIColor colorWithRed:0.7
                                 green:0.9
                                  blue:0.3
                                 alpha:1.0];

self.halo.backgroundColor = color.CGColor;

animation duration

Use animationDuration or pulseInterval property.

animation repeat count

Initialize using initWithRepeatCount: method, or set repeatCount property. The default value is INFINITY.

animation key values and times

Use properties fromValueForRadius or keyTimeForHalfOpacity.

enable/disable timing function for animation

Use property useTimingFunction

Demo

You can try to change the radius and color properties with demo app.

Special Thanks

Inspired by SVPulsingAnnotationView.

Author

Shuichi Tsutsumi

iOS freelancer in Japan. Welcome works from abroad!

Support via PayPal
Comments
  • Pulsing animation removed after bringing app back to the foreground

    Pulsing animation removed after bringing app back to the foreground

    When the demo app is running and the home button is pressed, the app is pushed to the background. When the app is launched again. the pulsing animation is gone.

    What would be the correct hook to bring the animation back on the screen ?

    opened by ddewaele 6
  • PulsingHaloLayer.m:28:1: Cannot synthesize weak property because the current deployment target does not support weak references

    PulsingHaloLayer.m:28:1: Cannot synthesize weak property because the current deployment target does not support weak references

    I receive the following error when trying to compile a debug version of the app.

    /Users/gregkockott/www/Mobile-App-iOS/Pods/PulsingHalo/PulsingHalo/PulsingHaloLayer.m:28:1: Cannot synthesize weak property because the current deployment target does not support weak references

    @implementation PulsingHaloLayer <-- HERE IS THE ISSUE

    opened by gregk8288 5
  • Problem with podspec file

    Problem with podspec file

    See issue https://github.com/CocoaPods/CocoaPods/issues/4636 The deployment target will be set to 4.3 if no target is added to the podspec file. This will result in a compile error.

    opened by sandman4sure 5
  • MultiHalo not working

    MultiHalo not working

    Hi !

    First thanks for this great code.

    I just have problem with integrating multiple Halo, but I have none with the simple one. And of course, I need the multiple one ^^

    I instantiate it in my specific view, as the documentation and the demo showed me.

    Cheers !

    opened by B-Rass 5
  • Modify using CAReplicatorLayer

    Modify using CAReplicatorLayer

    I think that MultiplePulsingHaloLayer is a duplicate. so I tried to improve it in CAReplicatorLayer.

    I was careful to backward compatibility.

    Regards best.

    opened by dealforest 4
  • App back to the foreground stop pulsing

    App back to the foreground stop pulsing

    Hi,

    I try press home button ant then i back to app PulsingHalo stop pulsing

    i try add this in PulsingHaloLayer.m:

      (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
    
        if (flag) {
           [self removeAllAnimations];
           [self removeFromSuperlayer];
        }
      }
    

    but not working

    opened by kshysius 3
  • Fix the non modular error

    Fix the non modular error

    This appears in my project

    Include of non-modular header inside framework module 'PulsingHalo.PulsingHalo'
    

    https://github.com/jessesquires/JSQMessagesViewController/pull/1284

    opened by harryworld 2
  • Added properties documentation

    Added properties documentation

    The default values or explanations were not showing up in the quick info tooltip (alt + click).

    More info would be great but I don't have time now to figure out what each property does. It would be great if you could continue this :smiley:. Documentation is very important.

    Fixed issue #16.

    opened by revolter 2
  • Setting Duration and Radius

    Setting Duration and Radius

    Hello,

    I seem to be having trouble with the callbacks to the PulsingHaloClass

    The INIT values load correctly, but after the ViewDidLoad runs there are no connections being made back to the "PulsingHaloLayer"

    None of these connections are working to adjust the halo:

    [self setupInitialValues];

    • (IBAction)radiusChanged:
    • (IBAction)colorChanged:

    My Method:

    • (void)HaloProximityFar {

      self.halo.radius = 140; self.halo.animationDuration = 12; }

    I'm using iOS7.1 with ARC and Storyboards and added using CocoaPods

    Thanks

    Michael

    opened by thetripler 2
  • Not add to my view

    Not add to my view

    I use below code but not showing anything

    let halo = PulsingHaloLayer()
            halo.position = view.center
            view.layer.addSublayer(halo)
            halo.start()
    
    opened by HFMohammad 1
  • Make the superview reference assign instead of weak

    Make the superview reference assign instead of weak

    @shu223 I'm not totally sure why this comes up when you do a pod update but this does seem to fix it and have the same effect so seems good to me. Also solves:

    https://github.com/shu223/PulsingHalo/issues/42

    opened by lappp9 1
  • Halo not working in user location?

    Halo not working in user location?

    Hello sir, thanks you for your library, the halo is not working for me, can you look in my code?

    thanks :)

    ` let halo = PulsingHaloLayer()

        if annotation is MKUserLocation {
          let pin = mapView.view(for: annotation) as? MKPinAnnotationView ?? MKPinAnnotationView(annotation: annotation, reuseIdentifier: nil)
            pin.image = #imageLiteral(resourceName: "iphoneiconmap").resized(with: CGSize(width: 10, height: 25))
            
            halo.position = view.center
            pin.layer.addSublayer(halo)
            halo.backgroundColor = #colorLiteral(red: 0.7579909581, green: 0.6050492619, blue: 0.005667506656, alpha: 1)
            halo.start()
            
           return pin
    
        }`
    

    the halo is showing but in the map not in the user location

    opened by ghost 0
  • Stops working on all controllers except initial view controller

    Stops working on all controllers except initial view controller

    I have this code on my initial view controller and then on my second view controller but it only works on the first view controller. let halo = PulsingHaloLayer() halo.position = view.center view.layer.addSublayer(halo) halo.backgroundColor = UIColor.blue.cgColor halo.animationDuration = 3 halo.repeatCount = 3 halo.start()

    opened by Hsanka6 1
  • Reverse the rings

    Reverse the rings

    Is it possible to make rings go inwards with animation? Like there will be big rings and then it get smaller and smaller?

    I tried to reverse the line numbers 133 and 134 in PulsingHaloLayer.m like below:

    scaleAnimation.fromValue = @1.0; scaleAnimation.toValue = @(self.fromValueForRadius);

    But this gives me weird blink effect.

    opened by Milan3792 0
  • Animation stops abruptly

    Animation stops abruptly

    Hello,

    I'm having a specific issue in implementing PulsingHalo in my project. I don't think the issue is specifically related to PulsingHalo, but I'm at a loss for a solution. I've opened a StackOverflow question on this, if you would be okay with taking a look. http://stackoverflow.com/questions/35844295/ios-layer-animation-stops-abruptly

    The basic problem is that the animation, for some reason, starts fine for a few seconds then suddenly completely stops for a second or two, then restarts normally, over and over.

    opened by Spoonrad 0
Releases(0.2.10)
Owner
Shuichi Tsutsumi
Freelance iOS Programmer
Shuichi Tsutsumi
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly

Simple Interface Core Animation Sica can execute various animations sequentially or parallelly. Features Animation with duration and delay parallel /

CATS Open Source Softwares 1k Nov 10, 2022
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan Glavaš 9 Nov 5, 2022
Library for creating swipe actions for any SwiftUI View

SwipeActions Library for creating swipe actions for any SwiftUI View, similar to

Alexander Kraev 24 Dec 26, 2022
A framework and generator for displaying SwiftUI component libraries

Exhibition Exhibition is a framework and generator for displaying a SwiftUI component library. Inspired by Storybook and Showkase Installation Swift P

Malcolm Jarvis 23 Dec 30, 2022
A SwiftUI component to make handling of email links better.

EmailLink A SwiftUI component to make handling of email links better. Not only will EmailLink use the correct default client, it will also prompt the

Joe Scotto 16 Sep 24, 2022
TRightImageButton is a simple and flexible UI component fully written in Swift.

TRightImageButton is a simple and flexible UI component fully written in Swift. TRightImageButton is developed to help programmers create a button with right image quickly without having to write many lines of codes.

Nguyen Duc Thinh 2 Aug 18, 2022
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Draven 1.9k Dec 9, 2022
Gemini is rich scroll based animation framework for iOS, written in Swift.

Overview What is the Gemini? Gemini is rich scroll based animation framework for iOS, written in Swift. You can easily use GeminiCollectionView, which

Shohei Yokoyama 3k Dec 27, 2022
Pulse animation for iOS written with Swift.

Pulsator Pulse animation for iOS written with Swift. Great For: Pulses of Bluetooth, BLE, beacons (iBeacon), etc. Map Annotations Installation CocoaPo

Shuichi Tsutsumi 1.3k Jan 6, 2023
Easy animation library on iOS with Swift2

Cheetah Cheetah is an animation utility on iOS with Swift. Cheetah can animate any properties since Cheetah uses simple CADisplayLink run loop to chan

Suguru Namura 592 Dec 6, 2022
A radical & elegant animation library for iOS.

Installation • Usage • Debugging • Animatable Properties • License Dance is a powerful and straightforward animation framework built upon the new UIVi

Saoud Rizwan 648 Dec 14, 2022
Pulse animation for iOS

Pulsator Pulse animation for iOS written with Swift. Great For: Pulses of Bluetooth, BLE, beacons (iBeacon), etc. Map Annotations Installation CocoaPo

Shuichi Tsutsumi 1.3k Jun 19, 2021
An extensible iOS and OS X animation library, useful for physics-based interactions.

Pop is an extensible animation engine for iOS, tvOS, and OS X. In addition to basic static animations, it supports spring and decay dynamic animations

Meta Archive 19.8k Dec 28, 2022
Swift animation library for iOS, tvOS and macOS.

anim is an animation library written in Swift with a simple, declarative API in mind. // moves box to 100,100 with default settings anim { self.bo

Onur Ersel 555 Dec 12, 2022
Animation library for iOS in Swift

TweenKit TweenKit is a powerful animation library that allows you to animate (or 'tween') anything. TweenKit's animations are also scrubbable, perfect

Steve Barnegren 1.3k Dec 18, 2022
Widgets iOS 14 animation with 3D and dynamic shadow. Customisable transform and duration.

SPPerspective About Animatable widgets from iOS 14. Same animation for transform and shadow. Customisable duration, perspective and shadow also. For v

Ivan Vorobei 290 Dec 29, 2022