TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Sparkle ring animation

Forums > SwiftUI

My goal is to create Apples activity ring sparkle effect. So I found Paul Hudson's Vortex library. There is already a spark effect, but I don't know how to create a custom one that fits my needs. I'm still quite new to SwiftUI animations. Does someone have an idea how to do it?

 VortexView(createSparkle()) {
                Circle()
                    .fill(.white)
                    .frame(width: 16)
                    .tag("circle")
            }
   func createSparkle() -> VortexSystem {
        let system = VortexSystem(tags: ["circle"])
        system.birthRate = 150
        system.emissionDuration = 0.2
        system.idleDuration = 0.5
        system.lifespan = 1.5
        system.speed = 1.5
        system.speedVariation = 0.2
        system.angle = .degrees(330)
        system.angleRange = .degrees(30)
        system.acceleration = [0, 3]
        system.dampingFactor = 4
        system.colors = .ramp(.white, .yellow, .yellow.opacity(0))
        system.size = 0.1
        system.sizeVariation = 0.1
        system.stretchFactor = 8
        return system
    }

Vortex project: https://github.com/twostraws/Vortex

   

Well done. You found the library.

But did you watch Sophie Hudson's brilliant Ted talk titled Making it Rain where she discusses Vortex in great detail?

1      

Thank you for the recommendation. I’ll try it out.

   

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.