Reputation: 2099
I am trying to draw a triangle like this one exactly
Can someone guide me how to achieve this as I tried a lot with no success?
my worst case scenario is to use a image but I don't want to do that.
Thanks a lot!
Upvotes: 0
Views: 2120
Reputation: 1226
Maybe you should try this:
let trianglePath = UIBezierPath()
trianglePath.lineJoinStyle = .round
trianglePath.lineWidth = 25
trianglePath.move(to: CGPoint(x: 5.0, y: 10.0))
trianglePath.addLine(to: CGPoint(x: 130, y: 280.0))
trianglePath.addLine(to: CGPoint(x: 265.0, y: 10.0))
trianglePath.close()
That gives you this in Playground:
Upvotes: 2