0

I am trying to draw a triangle like this one exactly enter image description here

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!

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
Mohamad Bachir Sidani
  • 2,077
  • 1
  • 11
  • 17

1 Answers1

2

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: enter image description here

DungeonDev
  • 1,176
  • 1
  • 12
  • 16