Code :
override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // declare a pulsing layer var pulsingLayer = YQPulsingLayer() // place the pulsing layer in the center the object view pulsingLayer.position = objectView.center // add the pulsing layer to the view view.layer.insertSublayer(pulsingLayer, below: objectView.layer) }
Link : https://github.com/yiqin/Pulse-Animation