圆角虚线
let borderLayer = CAShapeLayer()
borderLayer.strokeColor = UIColor.red.cgColor
borderLayer.lineDashPattern = [3,3]
borderLayer.backgroundColor = UIColor.clear.cgColor
borderLayer.fillColor = UIColor.clear.cgColor
bgView.layer.addSublayer(borderLayer)
borderLayer.path = UIBezierPath(roundedRect: bgView.bounds, cornerRadius: 8).cgPath
网友评论