2

I am attempting to convert my Swift 2 code into the latest syntax(Swift 3). I am receiving the following error:

Nil is not compatible with expected argument type 'UnsafePointer'

(Swift 2 Code)
CGPathAddArc(path, nil, overlayView.frame.width - radius/2 - xOffset, yOffset, radius, 0.0, 2 * 3.14, false)

Can someone please help me resolve this conversion syntax issue?

Cari95
  • 313
  • 6
  • 16
  • Possible duplicate of [Why is 'nil' not compatible with 'UnsafePointer' in Swift 3?](http://stackoverflow.com/questions/39041888/why-is-nil-not-compatible-with-unsafepointercgaffinetransform-in-swift-3) – Daniel Dec 30 '16 at 21:47
  • 2
    There is a new function to replace CGPathAddArc: path.`addArc:withCenter:radius:startAngle:clockwis` – bubuxu Dec 31 '16 at 03:16

1 Answers1

5
    path.addArc(withCenter: CGPoint(x: overlayView.frame.width - radius/2 - xOffset, y: yOffset),
                radius: radius,
                startAngle: 0,
                endAngle: CGFloat(M_PI) * 2,
                clockwise: false)
bubuxu
  • 2,187
  • 18
  • 23