I wanted to draw a triangle with rounded corners in my app. I already created a triangle like this:
How can I round the corners of this triangle?
Here is my code:
let path = UIBezierPath()
path.move(to: CGPoint(x: 0, y: 0))
path.addLine(to: CGPoint(x: 160, y: 90))
path.addLine(to: CGPoint(x: 0, y: 180))
path.close()
let maskLayer = CAShapeLayer()
maskLayer.path = path.cgPath
triangleView.layer.mask = triangleLayer
Thanks for any kind of help :D