Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func drawDashedLine() {
- let shapeLayer = CAShapeLayer()
- let bezierPath = UIBezierPath()
- let pointA = CGPoint(x: self.bounds.minX, y: self.bounds.midY)
- let pointB = CGPoint(x: self.bounds.maxX, y: self.bounds.midY)
- bezierPath.move(to: pointA)
- bezierPath.addLine(to: pointB)
- shapeLayer.fillColor = UIColor.white.cgColor
- shapeLayer.strokeColor = UIColor.white.cgColor
- shapeLayer.lineWidth = 2.0 / UIScreen.main.scale
- shapeLayer.lineJoin = kCALineJoinMiter
- shapeLayer.lineDashPattern = [ 6, 3 ]
- shapeLayer.path = bezierPath.cgPath
- backgroundColor = dashColor
- layer.mask = shapeLayer
- }
Add Comment
Please, Sign In to add comment