Open
Description
Hi, I'm trying to get a nice pulse below a round avatar view. The UIImageView itself is a rectangle spanning the entire screen, its image is a circle with aspect fit. When I add the pulsator view like this:
let pulsator = Pulsator()
pulsator.radius = 500
pulsator.numPulse = 3
pulsator.pulseInterval = 3
pulsator.animationDuration = 5
pulsator.backgroundColor = UIColor(red: 0, green: 0.623, blue: 0.890, alpha: 0.3).cgColor
self.avatarImageView.addSublayer(pulsator)
pulsator.start()
It works but the pulse comes from the top left of the UIImageView. I want it to spawn pulses from the center of the image, which is also the center of the UIImageView itself. How can I change the pulsator's position? Or how can I center it properly to the view?
Metadata
Metadata
Assignees
Labels
No labels