0

I am creating arc with below line

func drawSomething(_ context: CGContext, rect: CGRect) {
    context.saveGState()
    let path = UIBezierPath()

    let pathStartRagAngle = (0).degreesToRadians
    let pathEndRagAngle = (220).degreesToRadians

    path.addArc(withCenter: centerS, radius: rangeLabelsRect.size.width / 2.0, startAngle: CGFloat(pathStartRagAngle), endAngle: CGFloat(pathEndRagAngle - 0.01), clockwise: true)
    let color =  UIColor.red
    color.setStroke()
    path.lineWidth = rangeLabelsWidth
    path.stroke()
}

Gave this result enter image description here

what I wanted to do is add circle to end of red arc, for that I need CGPoint. so could find any way to do it,

David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205
Komal Kamble
  • 424
  • 1
  • 8
  • 25

1 Answers1

1

UIBezierPath has a currentPoint property which will be at the end of the last component you added to the path. That should work for you.

jrturton
  • 118,105
  • 32
  • 252
  • 268