Cari95
Cari95

Reputation: 313

Swift conversion: ERROR - CGPathAddArc

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?

Upvotes: 2

Views: 1232

Answers (1)

bubuxu
bubuxu

Reputation: 2197

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

Upvotes: 5

Related Questions