pmb pmb - 2 years ago 93
iOS Question

How to add view in center of view

I have view which has 200x200 width and height

let pulsator = Pulsator()
pulsator.radius = 240.0
pulsator.numPulse = 5

I want pulsator will be set center of viewSearchArea.
How could i do this?
If anyone wants to know what is pulsator here is the link

Answer Source

Try this.

pulsator.position = CGPoint(viewSearchArea.layer.bounds.midX, viewSearchArea.layer.bounds.midY)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download