I would like to show for a certain time (2 seconds) a circular sublayer that is in my function pointCamera
. But I can not find a way to do it, this is my code:
func pointCamera(centerPoint: CGPoint) {
let circlePath = UIBezierPath(arcCenter: centerPoint, radius: CGFloat(30), startAngle: CGFloat(0), endAngle: CGFloat(M_PI * 2), clockwise: true)
let shapeLayer = CAShapeLayer()
shapeLayer.path = circlePath.cgPath
shapeLayer.fillColor = UIColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 0.3).cgColor
shapeLayer.strokeColor = UIColor(red: 0, green: 191/255, blue: 1, alpha: 0.9).cgColor
shapeLayer.lineWidth = 2.0
cameraView.layer.addSublayer(shapeLayer)
}