Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulse is not centered to view #55

Open
kevinluscii opened this issue Aug 29, 2019 · 1 comment
Open

Pulse is not centered to view #55

kevinluscii opened this issue Aug 29, 2019 · 1 comment

Comments

@kevinluscii
Copy link

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?

@Kaakati
Copy link

Kaakati commented Sep 4, 2019

@kevinluscii Possible duplicate #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants